A toolkit for any func­tion

Once you have the chain rule, you can dif­fer­en­ti­ate any func­tion that is built out of stan­dard pieces, how­ever tan­gled it looks. So we start there. Then we col­lect the deriv­a­tives of the inverse trigono­met­ric, expo­nen­tial and log­a­rith­mic func­tions, and learn three tech­niques for awk­ward cases: implicit, log­a­rith­mic and para­met­ric dif­fer­en­ti­a­tion.

The chain rule

If y=f(u)y = f(u) and u=g(x)u = g(x), then dydx=dydu⋅dudx\displaystyle \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}. In words you can say to your­self while work­ing: dif­fer­en­ti­ate the out­side, keep the inside as it is, then mul­ti­ply by the deriv­a­tive of the inside.

Exam­ple 1. ddxsin⁡(3x2+1)=6xcos⁡(3x2+1)\displaystyle \tfrac{d}{dx}\sin(3x^2 + 1) = 6x\cos(3x^2 + 1). ddx(2x−5)7=14(2x−5)6\displaystyle \tfrac{d}{dx}(2x - 5)^7 = 14(2x - 5)^6. ddxcos⁡x=−sin⁡x2cos⁡x\displaystyle \tfrac{d}{dx}\sqrt{\cos x} = -\tfrac{\sin x}{2\sqrt{\cos x}}.

Stan­dard deriv­a­tives to know by heart

f(x)f(x) f′(x)f'(x)
exe^x exe^x
log⁡x\log x (x>0x > 0) 1x\displaystyle \tfrac{1}{x}
axa^x axlog⁡aa^x\log a
sin⁡−1x\sin^{-1}x 11−x2\displaystyle \tfrac{1}{\sqrt{1 - x^2}}
cos⁡−1x\cos^{-1}x −11−x2\displaystyle -\tfrac{1}{\sqrt{1 - x^2}}
tan⁡−1x\tan^{-1}x 11+x2\displaystyle \tfrac{1}{1 + x^2}
cot⁡−1x\cot^{-1}x −11+x2\displaystyle -\tfrac{1}{1 + x^2}
sec⁡−1x\sec^{-1}x 1∣x∣x2−1\displaystyle \tfrac{1}{\lvert x \rvert\sqrt{x^2 - 1}}

Exam­ple 2. ddxesin⁡x=cos⁡x esin⁡x\displaystyle \tfrac{d}{dx}e^{\sin x} = \cos x\, e^{\sin x}. ddxlog⁡(x2+4)=2xx2+4\displaystyle \tfrac{d}{dx}\log(x^2 + 4) = \tfrac{2x}{x^2 + 4}. ddxtan⁡−1(3x)=31+9x2\displaystyle \tfrac{d}{dx}\tan^{-1}(3x) = \tfrac{3}{1 + 9x^2}.

Exam­ple 3. y=sin⁡−12x1+x2\displaystyle y = \sin^{-1}\frac{2x}{1 + x^2} for ∣x∣<1\lvert x \rvert < 1. Do not dif­fer­en­ti­ate this head-on. Sub­sti­tute x=tan⁡θx = \tan\theta and it sim­pli­fies to y=2θ=2tan⁡−1xy = 2\theta = 2\tan^{-1}x, so dydx=21+x2\displaystyle \tfrac{dy}{dx} = \tfrac{2}{1 + x^2}.

Implicit dif­fer­en­ti­a­tion

Some­times the two vari­ables are tan­gled up and one can­not be pulled out on its own. No prob­lem: dif­fer­en­ti­ate both sides with respect to xx, remem­ber­ing that yy is a func­tion of xx.

Exam­ple 4. x2+xy+y2=7x^2 + xy + y^2 = 7. Dif­fer­en­ti­at­ing, 2x+y+xy′+2yy′=02x + y + x y' + 2y y' = 0, so y′=−2x+yx+2y\displaystyle y' = -\frac{2x + y}{x + 2y}.

Log­a­rith­mic dif­fer­en­ti­a­tion

When you face long prod­ucts and quo­tients, or a vari­able raised to a vari­able power, take log⁡\log first. It turns prod­ucts into sums, which are much eas­ier to han­dle.

Exam­ple 5. y=xxy = x^x. Tak­ing logs, log⁡y=xlog⁡x\log y = x\log x, so y′y=log⁡x+1\displaystyle \tfrac{y'}{y} = \log x + 1, and there­fore y′=xx(1+log⁡x)y' = x^x(1 + \log x).

Exam­ple 6. y=(x+1)2x−2(x+4)3\displaystyle y = \frac{(x + 1)^2\sqrt{x - 2}}{(x + 4)^3}. Tak­ing logs and dif­fer­en­ti­at­ing, y′y=2x+1+12(x−2)−3x+4\displaystyle \tfrac{y'}{y} = \tfrac{2}{x + 1} + \tfrac{1}{2(x - 2)} - \tfrac{3}{x + 4}.

Para­met­ric form and sec­ond deriv­a­tives

When both coor­di­nates are given in terms of a para­me­ter, x=f(t)x = f(t) and y=g(t)y = g(t), divide the two rates: dydx=dy/dtdx/dt\displaystyle \frac{dy}{dx} = \frac{dy/dt}{dx/dt}.

Exam­ple 7. x=3cos⁡tx = 3\cos t, y=3sin⁡ty = 3\sin t: dydx=3cos⁡t−3sin⁡t=−cot⁡t\displaystyle \tfrac{dy}{dx} = \tfrac{3\cos t}{-3\sin t} = -\cot t.

The circle of radius 3 traced by x = 3 cos t, y = 3 sin t, with the radius drawn at angle t to the point (3 cos t, 3 sin t) and the tangent there, of slope -cot t.
x = 3 cos t, y = 3 sin t traces a cir­cle of radius 3; the tan­gent at para­me­ter t has slope -cot t.

Exam­ple 8. x=at2x = at^2, y=2aty = 2at: dydx=2a2at=1t\displaystyle \tfrac{dy}{dx} = \tfrac{2a}{2at} = \tfrac{1}{t}.

The sec­ond deriv­a­tive d2ydx2\displaystyle \tfrac{d^2y}{dx^2} just means dif­fer­en­ti­at­ing dydx\displaystyle \tfrac{dy}{dx} once more. For exam­ple, if y=Asin⁡2x+Bcos⁡2xy = A\sin 2x + B\cos 2x, then y′′=−4yy'' = -4y, which is the same as y′′+4y=0y'' + 4y = 0.

Try these your­self

  1. Dif­fer­en­ti­ate: cos⁡(5x−2)\cos(5x - 2); (3x2−x+1)4(3x^2 - x + 1)^4; sin⁡3x\sin^3 x; 1+e2x\sqrt{1 + e^{2x}}.
  2. Dif­fer­en­ti­ate: ex2e^{x^2}; log⁡(sin⁡x)\log(\sin x); x2exx^2 e^x; log⁡xx\displaystyle \frac{\log x}{x}.
  3. Dif­fer­en­ti­ate: sin⁡−1(2x)\sin^{-1}(2x); tan⁡−1(ex)\tan^{-1}(e^x); cos⁡−11−x21+x2\displaystyle \cos^{-1}\frac{1 - x^2}{1 + x^2} for 0<x<10 < x < 1.
  4. Find dydx\displaystyle \tfrac{dy}{dx}: x3+y3=6xyx^3 + y^3 = 6xy; sin⁡(xy)+y=x\sin(xy) + y = x.
  5. Find dydx\displaystyle \tfrac{dy}{dx}: y=(sin⁡x)xy = (\sin x)^x; y=xsin⁡xy = x^{\sin x}; y=2x+x2y = 2^x + x^2.
  6. Find dydx\displaystyle \tfrac{dy}{dx}: x=t2+1x = t^2 + 1, y=t3−ty = t^3 - t; x=a(θ−sin⁡θ)x = a(\theta - \sin\theta), y=a(1−cos⁡θ)y = a(1 - \cos\theta).
  7. Find d2ydx2\displaystyle \tfrac{d^2y}{dx^2}: y=x3log⁡xy = x^3 \log x; y=e3xcos⁡xy = e^{3x}\cos x.
  8. If y=e2x+e−2xy = e^{2x} + e^{-2x}, show y′′=4yy'' = 4y.
  9. If y=tan⁡−1xy = \tan^{-1}x, show (1+x2)y′′+2xy′=0(1 + x^2)y'' + 2xy' = 0.
  10. If ey(x+1)=1e^y(x + 1) = 1, show y′′=(y′)2y'' = (y')^2.

Answers to check against

Show answers
  1. −5sin⁡(5x−2)-5\sin(5x - 2); 4(3x2−x+1)3(6x−1)4(3x^2 - x + 1)^3(6x - 1); 3sin⁡2xcos⁡x3\sin^2 x\cos x; e2x1+e2x\displaystyle \tfrac{e^{2x}}{\sqrt{1 + e^{2x}}}.
  2. 2xex22xe^{x^2}; cot⁡x\cot x; ex(x2+2x)e^x(x^2 + 2x); 1−log⁡xx2\displaystyle \tfrac{1 - \log x}{x^2}.
  3. 21−4x2\displaystyle \tfrac{2}{\sqrt{1 - 4x^2}}; ex1+e2x\displaystyle \tfrac{e^x}{1 + e^{2x}}; with x=tan⁡θx = \tan\theta it becomes 2tan⁡−1x2\tan^{-1}x, giv­ing 21+x2\displaystyle \tfrac{2}{1 + x^2}.
  4. 2y−x2y2−2x\displaystyle \tfrac{2y - x^2}{y^2 - 2x}; 1−ycos⁡(xy)1+xcos⁡(xy)\displaystyle \tfrac{1 - y\cos(xy)}{1 + x\cos(xy)}.
  5. (sin⁡x)x(log⁡sin⁡x+xcot⁡x)(\sin x)^x(\log\sin x + x\cot x); xsin⁡x(cos⁡xlog⁡x+sin⁡xx)\displaystyle x^{\sin x}\left(\cos x\log x + \tfrac{\sin x}{x}\right); 2xlog⁡2+2x2^x\log 2 + 2x.
  6. 3t2−12t\displaystyle \tfrac{3t^2 - 1}{2t}; sin⁡θ1−cos⁡θ=cot⁡θ2\displaystyle \tfrac{\sin\theta}{1 - \cos\theta} = \cot\tfrac{\theta}{2}.
  7. 6xlog⁡x+5x6x\log x + 5x; e3x(8cos⁡x−6sin⁡x)e^{3x}(8\cos x - 6\sin x).
  8. y′′=4e2x+4e−2xy'' = 4e^{2x} + 4e^{-2x}.
  9. y′=11+x2\displaystyle y' = \tfrac{1}{1 + x^2}, y′′=−2x(1+x2)2\displaystyle y'' = -\tfrac{2x}{(1 + x^2)^2}.
  10. y=−log⁡(x+1)y = -\log(x + 1): y′=−1x+1\displaystyle y' = -\tfrac{1}{x + 1}, y′′=1(x+1)2\displaystyle y'' = \tfrac{1}{(x + 1)^2}.