File size: 6,298 Bytes
7008d22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Examples (generated by math-steps.jar)

## diff `x^2 sin(x)`

```
Step 1: Product rule: (f g)' = f' g + f g', with f = x^2 and g = sin(x)
    (f*g)' = f'*g + f*g', f = x^2, g = sin(x)
    - Power rule: d/dx [x^n] = n x^(n-1)
        d/dx [x^2] = 2x
    - Standard derivative of sin(x)
        d/dx [sin(x)] = cos(x)
Step 2: Put it together
    d/dx [x^2*sin(x)] = x^2*cos(x) + 2x*sin(x)
Step 3: Answer
    d/dx [x^2*sin(x)] = x^2*cos(x) + 2x*sin(x)
```

## diff `(x+1)/(x-1)`

```
Step 1: Rewrite the expression
    (x + 1)/(x - 1)
Step 2: Quotient rule: (u/v)' = (u'v - uv') / v^2, with u = x + 1 and v = x - 1
    (u/v)' = (u'v - uv')/v^2, u = x + 1, v = x - 1
    - Sum rule: differentiate each term separately
        d/dx [x + 1] = d/dx [x] + d/dx [1]
        - Derivative of x
            d/dx [x] = 1
        - Constant rule: the derivative of a constant is 0
            d/dx [1] = 0
    - Add the results
        d/dx [x + 1] = 1
    - Sum rule: differentiate each term separately
        d/dx [x - 1] = d/dx [x] + d/dx [-1]
        - Derivative of x
            d/dx [x] = 1
        - Constant rule: the derivative of a constant is 0
            d/dx [-1] = 0
    - Add the results
        d/dx [x - 1] = 1
Step 3: Put it together and simplify
    d/dx [(x + 1)/(x - 1)] = -2/(x - 1)^2
Step 4: Answer
    d/dx [(x + 1)/(x - 1)] = -2/(x - 1)^2
```

## diff `e^(sin(3x))`

```
Step 1: Chain rule: d/dx [e^u] = e^u * u', where u = sin(3x)
    d/dx [e^u] = e^u*u', u = sin(3x)
    - Chain rule: d/dx [sin(u)] = cos(u) * u', where u = 3x
        d/dx [sin(u)] = cos(u) * u', u = 3x
        - Constant multiple rule: d/dx [c x] = c
            d/dx [3x] = 3
    - Put it together
        d/dx [sin(3x)] = 3cos(3x)
Step 2: Put it together
    d/dx [e^(sin(3x))] = 3cos(3x)*e^(sin(3x))
Step 3: Answer
    d/dx [e^(sin(3x))] = 3cos(3x)*e^(sin(3x))
```

## int `x e^x`

```
Step 1: Integration by parts: integral u dv = u v - integral v du (choose u by LIATE: logs, inverse trig, algebraic, trig, exponential)
    u = x, dv = e^x dx, du = 1 dx, v = e^x
Step 2: Now integrate v du
    integral e^x dx
    - Standard integral: integral e^u du = e^u
        Standard integral: integral e^u du = e^u  =>  integral e^x dx = e^x
Step 3: So u v - integral v du
    integral x*e^x dx = x*e^x - e^x
Step 4: Answer (add the constant of integration C)
    integral x*e^x dx = x*e^x - e^x + C
Step 5: Check: differentiating the answer gives back the integrand
    d/dx [x*e^x - e^x] = x*e^x  (checked)
```

## int `2x cos(x^2)`

```
Step 1: Constant multiple rule: take the constant 2 outside the integral
    integral 2x*cos(x^2) dx = 2 * integral x*cos(x^2) dx
    - Substitution: let u = x^2
        u = x^2, du = 2x dx
    - The integral becomes
        integral cos(u)/2 du
        - Constant multiple rule: take the constant 1/2 outside the integral
            integral cos(u)/2 du = 1/2 * integral cos(u) du
            - Standard integral: integral cos(u) du = sin(u)
                integral cos(u) du = sin(u)
        - Multiply by the constant
            integral cos(u)/2 du = sin(u)/2
    - Substitute back u = x^2
        integral x*cos(x^2) dx = sin(x^2)/2
Step 2: Multiply by the constant
    integral 2x*cos(x^2) dx = sin(x^2)
Step 3: Answer (add the constant of integration C)
    integral 2x*cos(x^2) dx = sin(x^2) + C
Step 4: Check: differentiating the answer gives back the integrand
    d/dx [sin(x^2)] = 2x*cos(x^2)  (checked)
```

## int `(x+3)/(x^2+3x+2)`

```
Step 1: Rewrite the expression
    (x + 3)/(x^2 + 3x + 2)
Step 2: The integrand is a ratio of polynomials: use partial fractions
    integral (x + 3)/(x^2 + 3x + 2) dx
Step 3: Partial fractions: factor the denominator as (x + 1)(x + 2) and split the fraction
    (x + 3)/(x^2 + 3x + 2) = 2/(x + 1) - 1/(x + 2)
    - integral A/(x - r) dx = A ln|x - r|
        integral 2/(x + 1) dx = 2ln|x + 1|
    - integral A/(x - r) dx = A ln|x - r|
        integral -1/(x + 2) dx = -ln|x + 2|
Step 4: Combine
    integral (x + 3)/(x^2 + 3x + 2) dx = 2ln|x + 1| - ln|x + 2|
Step 5: Answer (add the constant of integration C)
    integral (x + 3)/(x^2 + 3x + 2) dx = 2ln|x + 1| - ln|x + 2| + C
Step 6: Check: differentiating the answer gives back the integrand
    d/dx [2ln|x + 1| - ln|x + 2|] = (x + 3)/(x^2 + 3x + 2)  (checked)
```

## int `sin(x)^2`

```
Step 1: Use the identity sin^2(u) = (1 - cos(2u))/2
    Use the identity sin^2(u) = (1 - cos(2u))/2  =>  integral sin(x)^2 dx = integral (1 - cos(2x))/2 dx
    - Constant multiple rule: take the constant 1/2 outside the integral
        integral (1 - cos(2x))/2 dx = 1/2 * integral (1 - cos(2x)) dx
        - Sum rule: integrate each term separately
            integral (1 - cos(2x)) dx = integral -cos(2x) dx + integral 1 dx
            - Constant multiple rule: take the constant -1 outside the integral
                integral -cos(2x) dx = -1 * integral cos(2x) dx
                - Standard integral: integral cos(u) du = sin(u), with the linear substitution u = 2x (du = 2 dx, so divide by 2)
                    Standard integral: integral cos(u) du = sin(u), u = 2x  =>  integral cos(2x) dx = sin(2x)/2
            - Multiply by the constant
                integral -cos(2x) dx = -sin(2x)/2
            - Integral of a constant: integral c dx = c x
                integral 1 dx = x
        - Add the results
            integral (1 - cos(2x)) dx = x - sin(2x)/2
    - Multiply by the constant
        integral (1 - cos(2x))/2 dx = (x - sin(2x)/2)/2
Step 2: So
    integral sin(x)^2 dx = (x - sin(2x)/2)/2
Step 3: Answer (add the constant of integration C)
    integral sin(x)^2 dx = x/2 - sin(2x)/4 + C
Step 4: Check: differentiating the answer gives back the integrand
    d/dx [x/2 - sin(2x)/4] = sin(x)^2  (checked)
```

## defint `sin(x)` from 0 to pi

```
Step 1: Standard integral: integral sin(u) du = -cos(u)
    Standard integral: integral sin(u) du = -cos(u)  =>  integral sin(x) dx = -cos(x)
Step 2: Fundamental theorem of calculus: integral from a to b of f = F(b) - F(a), with F = -cos(x)
    integral from 0 to pi = [-cos(x)] from 0 to pi
Step 3: Evaluate at the limits
    F(pi) - F(0) = (1) - (-1) = 2
Step 4: Answer
    integral from 0 to pi of sin(x) dx = 2
Step 5: Check: a numerical integration gives the same value
    Simpson's rule ~ 2
```