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

Example 36: y=Asin⁡x+Bcos⁡xy=A\sin x+B\cos x satisfies y′′+y=0y''+y=0

ExamplesSecond order derivative · Section 5.7
The question

If y=Asin⁡x+Bcos⁡xy = A\sin x + B\cos x⁠, then prove that d2ydx2+y=0\dfrac{d^2y}{dx^2} + y = 0⁠.

Exam answer

Here y=Asin⁡x+Bcos⁡xy = A\sin x + B\cos x⁠.

Differentiating w.r.t. xx⁠,

dydx=Acos⁡x−Bsin⁡x\frac{dy}{dx} = A\cos x - B\sin x

Differentiating again,

d2ydx2=−Asin⁡x−Bcos⁡x=−(Asin⁡x+Bcos⁡x)=−y\begin{aligned} \frac{d^2y}{dx^2} &= -A\sin x - B\cos x \\ &= -(A\sin x + B\cos x) = -y \end{aligned}

∴ d2ydx2+y=0\therefore\ \dfrac{d^2y}{dx^2} + y = 0⁠. Hence proved.

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

The one idea this problem is built on

Differentiating sine and cosine twice brings each one back with a minus sign:

d2dx2sin⁡x=−sin⁡x,d2dx2cos⁡x=−cos⁡x.\begin{aligned} \frac{d^2}{dx^2}\sin x &= -\sin x, \\ \frac{d^2}{dx^2}\cos x &= -\cos x. \end{aligned}

So the second derivative of any combination Asin⁡x+Bcos⁡xA\sin x + B\cos x is minus that same combination, −y-y⁠, and adding yy gives zero.

Given, to show, and the plan
Given
y=Asin⁡x+Bcos⁡xy = A\sin x + B\cos x⁠, where AA and BB are constants (any real numbers) and xx is any real number.
To show
d2ydx2+y=0\dfrac{d^2y}{dx^2} + y = 0 for every real xx⁠.
Plan
Differentiate twice, then recognise the second derivative as −y-y⁠.

Basics you need

1Derivatives of sine and cosine

ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos x and ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x (Table 5.3), for every real xx⁠. Basics: derivative rules

2Constants and sums

ddx(A u+B v)=A u′+B v′\frac{d}{dx}\big(A\,u + B\,v\big) = A\,u' + B\,v' when AA⁠, BB are constants. A letter like AA is a constant because it does not change when xx changes. Basics: derivative rules

3Second order derivative (Section 5.7)

d2ydx2=ddx(dydx)\frac{d^2y}{dx^2} = \frac{d}{dx}\left(\frac{dy}{dx}\right)⁠. Lesson: second order derivative

Solution

  1. First derivative

    dydx=Acos⁡x+B(−sin⁡x)=Acos⁡x−Bsin⁡x.\begin{aligned} \frac{dy}{dx} &= A\cos x + B(-\sin x) \\ &= A\cos x - B\sin x. \end{aligned}
    Each term is a constant times a standard function, so the constants stay in front (Basic 2) and we use Basic 1 for sin⁡x\sin x and cos⁡x\cos x⁠.
    ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x⁠: this minus sign produces the −Bsin⁡x-B\sin x⁠. Basics: derivative rules
  2. Second derivative

    Differentiate dydx\frac{dy}{dx} again:

    d2ydx2=ddx(Acos⁡x−Bsin⁡x)=A(−sin⁡x)−Bcos⁡x=−Asin⁡x−Bcos⁡x.\begin{aligned} \frac{d^2y}{dx^2} &= \frac{d}{dx}\left(A\cos x - B\sin x\right) \\ &= A(-\sin x) - B\cos x \\ &= -A\sin x - B\cos x. \end{aligned}
    By definition the second derivative is the derivative of the first derivative (Basic 3). Again the constants AA and BB stay in front, cos⁡x\cos x becomes −sin⁡x-\sin x⁠, and sin⁡x\sin x becomes cos⁡x\cos x⁠.
  3. Recognise −y-y

    Take out the common factor −1-1⁠:

    d2ydx2=−(Asin⁡x+Bcos⁡x)=−y.\frac{d^2y}{dx^2} = -\left(A\sin x + B\cos x\right) = -y.
    The bracket is exactly the given expression for yy⁠. Seeing this is the point of the problem: the second derivative reproduces the original function, up to sign.
    Factorising: −p−q=−(p+q)-p - q = -(p + q)⁠.
  4. Conclude

    Add yy to both sides:

    d2ydx2+y=−y+y=0.\frac{d^2y}{dx^2} + y = -y + y = 0.

    Every step holds for every real xx and for any constants AA⁠, BB⁠, so d2ydx2+y=0\dfrac{d^2y}{dx^2} + y = 0 for all xx⁠.

    The statement to prove is an equation involving d2ydx2\frac{d^2y}{dx^2} and yy⁠. Once we know d2ydx2=−y\frac{d^2y}{dx^2} = -y⁠, substituting it makes the left side zero. No special values of xx⁠, AA or BB were used, so the result is general.
    An equation linking a function and its derivatives is called a differential equation; you will meet them in Chapter 9. Here every function of the form Asin⁡x+Bcos⁡xA\sin x + B\cos x is a solution of y′′+y=0y'' + y = 0⁠.
Result

For y=Asin⁡x+Bcos⁡xy = A\sin x + B\cos x⁠: dydx=Acos⁡x−Bsin⁡x\dfrac{dy}{dx} = A\cos x - B\sin x and d2ydx2=−Asin⁡x−Bcos⁡x=−y\dfrac{d^2y}{dx^2} = -A\sin x - B\cos x = -y⁠. Hence d2ydx2+y=0\dfrac{d^2y}{dx^2} + y = 0 for all real xx⁠, whatever the constants AA and BB⁠.

Check it with numbers

Take A=2A = 2⁠, B=−3B = -3⁠, x=1x = 1⁠. Then y=2sin⁡1−3cos⁡1y = 2\sin 1 - 3\cos 1⁠, which is about 1.6829420−1.6209069=0.06203511.6829420 - 1.6209069 = 0.0620351⁠.

Estimate d2ydx2\frac{d^2y}{dx^2} from three values with h=0.001h = 0.001⁠: y(0.999)≈0.0584300040285y(0.999) \approx 0.0584300040285⁠, y(1)≈0.0620350520114y(1) \approx 0.0620350520114⁠, y(1.001)≈0.0656400379592y(1.001) \approx 0.0656400379592⁠, so

y(1.001)−2y(1)+y(0.999)≈−0.000000062035,\begin{aligned} &y(1.001) - 2y(1) + y(0.999) \\ &\approx -0.000000062035, \end{aligned}

and dividing by h2=0.000001h^2 = 0.000001 gives d2ydx2≈−0.062035\frac{d^2y}{dx^2} \approx -0.062035⁠.

So d2ydx2+y≈−0.062035+0.062035=0\frac{d^2y}{dx^2} + y \approx -0.062035 + 0.062035 = 0 to six decimal places, as proved.

Common mistakes
  1. Sign errors. ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x but ddxsin⁡x=+cos⁡x\frac{d}{dx}\sin x = +\cos x⁠. Mixing these up gives d2ydx2=y\frac{d^2y}{dx^2} = y or other wrong forms.
  2. Treating AA and BB as variables. They are constants; their derivatives are zero, and they simply stay in front.
  3. Checking only special values. Showing the equation for A=1A = 1⁠, B=0B = 0 is not a proof. The algebra must keep AA and BB general.
What to take away
  1. sin⁡x\sin x and cos⁡x\cos x each satisfy y′′=−yy'' = -y⁠, and so does every combination Asin⁡x+Bcos⁡xA\sin x + B\cos x⁠.
  2. To "prove" a relation between yy and its derivatives: compute the derivatives, then substitute and simplify.
  3. Exercise 5.7, Question 11 (y=5cos⁡x−3sin⁡xy = 5\cos x - 3\sin x⁠) is this example with A=−3A = -3⁠, B=5B = 5⁠.

Every fact used, and where it comes from

FactUsed inSource
ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos x⁠, ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin xSteps 1, 2Table 5.3, Section 5.3
Constant multiple and sum rulesSteps 1, 2Algebra 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)
Differential equationsStep 4Chapter 9 (preview)
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 →