Class 12 Maths, Worked in Full Past papersGet updates
Chapter 5 · Continuity and Differentiability

Example 35: d2ydx2\frac{d^2y}{dx^2} for y=x3+tan⁡xy=x^3+\tan x

ExamplesSecond order derivative · Section 5.7
The question

Find d2ydx2\dfrac{d^2y}{dx^2}⁠, if y=x3+tan⁡xy = x^3 + \tan x⁠.

Exam answer

Here y=x3+tan⁡xy = x^3 + \tan x⁠.

Differentiating w.r.t. xx⁠,

dydx=3x2+sec⁡2x\frac{dy}{dx} = 3x^2 + \sec^2 x

Differentiating again (chain rule for sec⁡2x\sec^2 x⁠),

d2ydx2=6x+2sec⁡x⋅sec⁡xtan⁡x\frac{d^2y}{dx^2} = 6x + 2\sec x\cdot\sec x\tan x

∴ d2ydx2=6x+2sec⁡2xtan⁡x\therefore\ \dfrac{d^2y}{dx^2} = 6x + 2\sec^2 x\tan x (x≠(2n+1)π2, n∈Z)(x \ne (2n + 1)\dfrac{\pi}{2},\ n \in \Z)⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

The second derivative is simply the derivative of the derivative:

d2ydx2=ddx(dydx).\frac{d^2y}{dx^2} = \frac{d}{dx}\left(\frac{dy}{dx}\right).

So we differentiate once, then differentiate the result again. The only new ingredient in the second round is sec⁡2x\sec^2 x⁠, which needs the chain rule.

Given, to find, and the plan
Given
y=x3+tan⁡xy = x^3 + \tan x⁠, defined wherever tan⁡x\tan x is, that is for x≠(2n+1)π2x \neq (2n+1)\frac{\pi}{2}⁠, n∈Zn \in \Z⁠.
To find
d2ydx2\dfrac{d^2y}{dx^2}⁠.
Plan
Find dydx\frac{dy}{dx} term by term. Differentiate it again: 3x23x^2 by the power rule, sec⁡2x=(sec⁡x)2\sec^2 x = (\sec x)^2 by the chain rule. Cross-check the sec⁡2x\sec^2 x part a second way.

Basics you need

1Second order derivative (Section 5.7)

If y=f(x)y = f(x) and f′(x)f'(x) is itself differentiable, then d2ydx2=ddx(dydx)\frac{d^2y}{dx^2} = \frac{d}{dx}\left(\frac{dy}{dx}\right)⁠. It is also written f′′(x)f''(x)⁠, y′′y''⁠, y2y_2 or D2yD^2y⁠. Lesson: second order derivative

2Standard derivatives

ddxxn=n xn−1\frac{d}{dx}x^n = n\,x^{n-1} and ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2 x (Table 5.3). Also ddxsec⁡x=sec⁡xtan⁡x\frac{d}{dx}\sec x = \sec x\tan x⁠, which follows from the quotient rule (uv)′=u′v−uv′v2\left(\frac{u}{v}\right)' = \frac{u'v - uv'}{v^2} with u=1u = 1⁠, u′=0u' = 0⁠, v=cos⁡xv = \cos x⁠:

ddx1cos⁡x=0−1⋅(−sin⁡x)cos⁡2x=sin⁡xcos⁡2x.\begin{aligned} \frac{d}{dx}\frac{1}{\cos x} &= \frac{0 - 1\cdot(-\sin x)}{\cos^2 x} \\ &= \frac{\sin x}{\cos^2 x}. \end{aligned}

And sin⁡xcos⁡2x=1cos⁡x⋅sin⁡xcos⁡x=sec⁡xtan⁡x\frac{\sin x}{\cos^2 x} = \frac{1}{\cos x}\cdot\frac{\sin x}{\cos x} = \sec x\tan x⁠. Basics: derivative rules

3Chain rule for a square

ddx(u2)=2u dudx\frac{d}{dx}\big(u^2\big) = 2u\,\frac{du}{dx}⁠, where uu is any differentiable function of xx⁠. Lesson: chain rule

4sec⁡2x=1+tan⁡2x\sec^2 x = 1 + \tan^2 x

Divide cos⁡2x+sin⁡2x=1\cos^2 x + \sin^2 x = 1 by cos⁡2x\cos^2 x⁠. Used for the cross-check in Step 5. Basics: trigonometric identities

Solution

  1. Find the first derivative

    Differentiate term by term (sum rule):

    dydx=ddx(x3)+ddx(tan⁡x)=3x2+sec⁡2x.\begin{aligned} \frac{dy}{dx} &= \frac{d}{dx}\left(x^3\right) + \frac{d}{dx}\left(\tan x\right) \\ &= 3x^2 + \sec^2 x. \end{aligned}
    The second derivative is built on the first, so we need dydx\frac{dy}{dx} first. Both pieces are standard derivatives from Table 5.3. This holds at every xx where tan⁡x\tan x is defined, since cos⁡x≠0\cos x \neq 0 there.
    Power rule with n=3n = 3⁠; ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2 x⁠. Basics: derivative rules
  2. Set up the second derivative

    d2ydx2=ddx(3x2+sec⁡2x)=ddx(3x2)+ddx(sec⁡2x).\begin{aligned} \frac{d^2y}{dx^2} &= \frac{d}{dx}\left(3x^2 + \sec^2 x\right) \\ &= \frac{d}{dx}\left(3x^2\right) + \frac{d}{dx}\left(\sec^2 x\right). \end{aligned}
    By definition (Basic 1), the second derivative is what we get by differentiating dydx\frac{dy}{dx} once more. The sum rule lets us treat the two terms one at a time.
    Section 5.7: d2ydx2=ddx(dydx)\frac{d^2y}{dx^2} = \frac{d}{dx}\left(\frac{dy}{dx}\right)⁠. Lesson: second order derivative
  3. Differentiate 3x23x^2

    ddx(3x2)=3⋅2x=6x.\frac{d}{dx}\left(3x^2\right) = 3\cdot 2x = 6x.
    The constant 3 stays in front and the power rule gives 2x2x⁠.
    Power rule with n=2n = 2⁠.
  4. Differentiate sec⁡2x\sec^2 x with the chain rule

    sec⁡2x\sec^2 x means (sec⁡x)2(\sec x)^2⁠: the outer function is "square", the inner function is u=sec⁡xu = \sec x⁠. By Basic 3 and Basic 2,

    ddx(sec⁡x)2=2sec⁡x⋅ddx(sec⁡x)=2sec⁡x⋅sec⁡xtan⁡x.\begin{aligned} \frac{d}{dx}(\sec x)^2 &= 2\sec x\cdot\frac{d}{dx}(\sec x) \\ &= 2\sec x\cdot\sec x\tan x. \end{aligned}

    So ddx(sec⁡2x)=2sec⁡2xtan⁡x\dfrac{d}{dx}\left(\sec^2 x\right) = 2\sec^2 x\tan x⁠.

    A common error is to write ddxsec⁡2x=2sec⁡x\frac{d}{dx}\sec^2 x = 2\sec x⁠, forgetting to multiply by the derivative of the inside. The chain rule says: differentiate the square (giving 2sec⁡x2\sec x⁠), then multiply by the derivative of sec⁡x\sec x (giving sec⁡xtan⁡x\sec x\tan x⁠).
    Chain rule, Theorem 4 (Section 5.3.1), with outer function u2u^2 and inner function u=sec⁡xu = \sec x⁠. Lesson: chain rule
  5. Cross-check the sec⁡2x\sec^2 x derivative

    Using sec⁡2x=1+tan⁡2x\sec^2 x = 1 + \tan^2 x (Basic 4), and the chain rule on tan⁡2x=(tan⁡x)2\tan^2 x = (\tan x)^2⁠:

    ddx(1+tan⁡2x)=0+2tan⁡x⋅sec⁡2x.\frac{d}{dx}\left(1 + \tan^2 x\right) = 0 + 2\tan x\cdot\sec^2 x.

    This is 2sec⁡2xtan⁡x2\sec^2 x\tan x again.

    Reaching the same derivative by a different route confirms Step 4. It also shows that ddxsec⁡2x\frac{d}{dx}\sec^2x can be written in several equivalent forms.
    ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2 x (Table 5.3). Basics: trigonometric identities
  6. Put the pieces together

    d2ydx2=6x+2sec⁡2xtan⁡x,\frac{d^2y}{dx^2} = 6x + 2\sec^2 x\tan x,

    valid for every x≠(2n+1)π2x \neq (2n+1)\frac{\pi}{2}⁠, the same xx for which yy is defined.

    Add the results of Steps 3 and 4. The condition on xx is inherited from tan⁡x\tan x⁠: wherever cos⁡x≠0\cos x \neq 0⁠, the functions sec⁡x\sec x and tan⁡x\tan x are differentiable, so differentiating twice is allowed.
    Sum rule (u+v)′=u′+v′(u+v)' = u' + v'⁠.
Result d2ydx2=6x+2sec⁡2xtan⁡x,\frac{d^2y}{dx^2} = 6x + 2\sec^2 x\tan x,

for every x≠(2n+1)π2x \neq (2n+1)\frac{\pi}{2}⁠, n∈Zn \in \Z⁠. (Book's answer: 6x+2sec⁡2xtan⁡x6x + 2\sec^2 x\tan x⁠.)

Check it with numbers

Take x=0.5x = 0.5⁠. The formula gives 6(0.5)+2sec⁡2(0.5)tan⁡(0.5)6(0.5) + 2\sec^2(0.5)\tan(0.5)⁠, which is about 3+1.4186890=4.41868903 + 1.4186890 = 4.4186890⁠.

A second derivative can be estimated from three nearby values: y(x+h)−2y(x)+y(x−h)h2\frac{y(x+h) - 2y(x) + y(x-h)}{h^2}⁠. With h=0.001h = 0.001⁠:

y(0.499)≈0.669256250958y(0.499) \approx 0.669256250958⁠, y(0.5)≈0.671302489844y(0.5) \approx 0.671302489844⁠, y(0.501)≈0.673353147420y(0.501) \approx 0.673353147420⁠.

y(0.501)−2y(0.5)+y(0.499)≈0.000004418690,\begin{aligned} &y(0.501) - 2y(0.5) + y(0.499) \\ &\approx 0.000004418690, \end{aligned}

and dividing by h2=0.000001h^2 = 0.000001 gives about 4.418694.41869⁠.

This agrees with the formula to five significant figures.

Common mistakes
  1. Dropping the inner derivative. ddxsec⁡2x≠2sec⁡x\frac{d}{dx}\sec^2 x \neq 2\sec x⁠. The factor sec⁡xtan⁡x\sec x\tan x from the inside function is essential.
  2. Squaring the first derivative. d2ydx2\frac{d^2y}{dx^2} is not (dydx)2\left(\frac{dy}{dx}\right)^2⁠. It means "differentiate twice".
  3. Getting ddxsec⁡x\frac{d}{dx}\sec x wrong. It is sec⁡xtan⁡x\sec x\tan x⁠, not tan⁡2x\tan^2 x or sec⁡2x\sec^2 x⁠. Rederive it from 1cos⁡x\frac{1}{\cos x} if unsure (Basic 2).
What to take away
  1. Second derivative = differentiate, then differentiate the answer. No new rules are needed, only care.
  2. Powers of trigonometric functions, such as sec⁡2x\sec^2 x and tan⁡2x\tan^2 x⁠, always need the chain rule.
  3. ddxsec⁡2x=2sec⁡2xtan⁡x\frac{d}{dx}\sec^2 x = 2\sec^2 x\tan x is worth remembering; it appears whenever tan⁡x\tan x is differentiated twice.

Every fact used, and where it comes from

FactUsed inSource
ddxxn=n xn−1\frac{d}{dx}x^n = n\,x^{n-1}⁠, ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2 xSteps 1, 3, 5Table 5.3, Section 5.3
Sum ruleSteps 1, 2, 6Algebra of derivatives, Section 5.3
d2ydx2=ddx(dydx)\frac{d^2y}{dx^2} = \frac{d}{dx}\left(\frac{dy}{dx}\right)Step 2Section 5.7 (Lesson: second order derivative)
ddxsec⁡x=sec⁡xtan⁡x\frac{d}{dx}\sec x = \sec x\tan xStep 4Quotient rule, Section 5.3 (Basic 2)
Chain ruleSteps 4, 5Theorem 4, Section 5.3.1 (Lesson: chain rule)
sec⁡2x=1+tan⁡2x\sec^2 x = 1 + \tan^2 xStep 5Pythagorean identity divided by cos⁡2x\cos^2 x
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →