Class 12 Maths, Worked in Full Past papersGet updates
Chapter 9 · Differential Equations

Example 3: y=acos⁡x+bsin⁡xy = a\cos x + b\sin x solves y′′+y=0y'' + y = 0

ExamplesVerifying a solution · Section 9.3
The question

Verify that the function y=acos⁡x+bsin⁡xy = a\cos x + b\sin x⁠, where, a,b∈Ra, b \in \mathbf{R} is a solution of the differential equation d2ydx2+y=0\dfrac{d^2y}{dx^2} + y = 0

Exam answer

Given

y=acos⁡x+bsin⁡x…(i)y = a\cos x + b\sin x\quad\ldots(\text{i})

Differentiating (i) with respect to xx⁠, successively,

dydx=−asin⁡x+bcos⁡xd2ydx2=−acos⁡x−bsin⁡x\begin{aligned} \frac{dy}{dx} &= -a\sin x + b\cos x \\ \frac{d^2y}{dx^2} &= -a\cos x - b\sin x \end{aligned}

Substituting d2ydx2\frac{d^2y}{dx^2} and yy in the given equation,

L.H.S.=(−acos⁡x−bsin⁡x)+(acos⁡x+bsin⁡x)=0=R.H.S.\begin{aligned} \text{L.H.S.} &= (-a\cos x - b\sin x) \\ &\quad + (a\cos x + b\sin x) \\ &= 0 = \text{R.H.S.} \end{aligned}

∴\therefore y=acos⁡x+bsin⁡xy = a\cos x + b\sin x is a solution of the given differential equation.

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

The one idea this problem is built on

Differentiating cos⁡x\cos x twice gives −cos⁡x-\cos x⁠, and differentiating sin⁡x\sin x twice gives −sin⁡x-\sin x⁠. So for any mix y=acos⁡x+bsin⁡xy = a\cos x + b\sin x⁠, the second derivative is exactly −y-y⁠, which is what y′′+y=0y'' + y = 0 says. The constants aa and bb just ride along, so the check works for all of them at once.

Given, to find, and the plan
Given
y=acos⁡x+bsin⁡xy = a\cos x + b\sin x⁠, with arbitrary real constants aa⁠, bb⁠; defined for every real xx⁠. The equation d2ydx2+y=0\frac{d^2y}{dx^2} + y = 0⁠.
To show
That the function satisfies the equation for every real xx and every choice of a,ba, b⁠.
Plan
(1) Find dydx\frac{dy}{dx}⁠. (2) Find d2ydx2\frac{d^2y}{dx^2}⁠. (3) Substitute into the left side and simplify to 0. (4) Conclude, and count the constants against the order.

Basics you need

1What a solution is

A function is a solution when substituting it and its derivatives makes L.H.S. = R.H.S. (Section 9.3). Lesson: general and particular solutions

2Derivatives 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⁠; a constant factor stays in front (Chapter 5). Basics: y′ and y″

3Arbitrary constants and the order

A general solution of an equation of order nn carries nn arbitrary constants; a particular solution carries none (Section 9.3 and the chapter Summary). Basics: order n gives n constants

Solution

  1. First derivative

    dydx=a(−sin⁡x)+bcos⁡x=−asin⁡x+bcos⁡x.\begin{aligned} \frac{dy}{dx} &= a(-\sin x) + b\cos x \\ &= -a\sin x + b\cos x. \end{aligned}
    Differentiate term by term. The constants aa and bb stay as factors because the derivative of a constant multiple is the constant times the derivative.
    (cos⁡x)′=−sin⁡x(\cos x)' = -\sin x⁠, (sin⁡x)′=cos⁡x(\sin x)' = \cos x⁠. Basics: y′ and y″
  2. Second derivative

    d2ydx2=−acos⁡x+b(−sin⁡x)=−acos⁡x−bsin⁡x=−(acos⁡x+bsin⁡x)=−y.\begin{aligned} \frac{d^2y}{dx^2} &= -a\cos x + b(-\sin x) \\ &= -a\cos x - b\sin x \\ &= -(a\cos x + b\sin x) = -y. \end{aligned}
    Differentiating −asin⁡x-a\sin x gives −acos⁡x-a\cos x⁠, and differentiating bcos⁡xb\cos x gives −bsin⁡x-b\sin x⁠. The result is the original function with its sign changed, which is the key fact.
    The second derivative is the derivative of the first (Section 5.7). Basics: y′ and y″
  3. Substitute into the left side

    L.H.S.=d2ydx2+y=(−acos⁡x−bsin⁡x)+(acos⁡x+bsin⁡x)=0=R.H.S.\begin{aligned} \text{L.H.S.} &= \frac{d^2y}{dx^2} + y \\ &= (-a\cos x - b\sin x) \\ &\quad + (a\cos x + b\sin x) \\ &= 0 = \text{R.H.S.} \end{aligned}
    The acos⁡xa\cos x terms cancel and the bsin⁡xb\sin x terms cancel. The first derivative is not needed in the substitution, because dydx\frac{dy}{dx} does not appear in the equation; it was only a stage on the way to d2ydx2\frac{d^2y}{dx^2}⁠.
    Section 9.3: substitute and compare the two sides. Lesson: is it a solution?
  4. Conclude, and count the constants

    Step 3 holds for every real xx and for every choice of a,b∈Ra, b \in \mathbf{R}⁠. So y=acos⁡x+bsin⁡xy = a\cos x + b\sin x is a solution of d2ydx2+y=0\frac{d^2y}{dx^2} + y = 0⁠.

    It contains two arbitrary constants, aa and bb⁠, as many as the order of the equation (2). Giving them values gives particular solutions: for example a=1a = 1⁠, b=0b = 0 gives y=cos⁡xy = \cos x⁠, and a=0a = 0⁠, b=1b = 1 gives y=sin⁡xy = \sin x⁠.

    Because aa and bb were never given values, one calculation proves the claim for the whole family at once. The count of constants matches the order, which is what the chapter Summary asks of a general solution.
    Section 9.3: general and particular solutions; the chapter Summary: as many constants as the order. Basics: order n gives n constants
  5. The same family as the book's asin⁡(x+b)a\sin(x + b)

    Section 9.3 uses y=Asin⁡(x+B)y = A\sin(x + B) as a solution of the same equation. By the addition formula,

    Asin⁡(x+B)=(Asin⁡B)cos⁡x+(Acos⁡B)sin⁡x,\begin{aligned} A\sin(x + B) &= (A\sin B)\cos x \\ &\quad + (A\cos B)\sin x, \end{aligned}

    which is acos⁡x+bsin⁡xa\cos x + b\sin x with a=Asin⁡Ba = A\sin B and b=Acos⁡Bb = A\cos B⁠. Conversely, any a,ba, b arise this way: take A=a2+b2A = \sqrt{a^2 + b^2} and an angle BB with sin⁡B=aA\sin B = \frac{a}{A}⁠, cos⁡B=bA\cos B = \frac{b}{A} (when A≠0A \ne 0⁠).

    The two forms describe the same functions, so a general solution can look different in different books and still be correct. This matters when you compare your answer with a key.
    sin⁡(x+B)=sin⁡xcos⁡B+cos⁡xsin⁡B\sin(x + B) = \sin x\cos B + \cos x\sin B (Class XI). Lesson: general and particular solutions
Result

With y′′=−acos⁡x−bsin⁡xy'' = -a\cos x - b\sin x⁠, L.H.S. =y′′+y=0== y'' + y = 0 = R.H.S. for every real xx and all a,b∈Ra, b \in \mathbf{R}⁠, so y=acos⁡x+bsin⁡xy = a\cos x + b\sin x is a solution of d2ydx2+y=0\frac{d^2y}{dx^2} + y = 0⁠. (Textbook answer: the same, L.H.S. = 0 = R.H.S.)

Check it with numbers

Take a=2a = 2⁠, b=3b = 3 and x=1x = 1⁠. Then y=2cos⁡1+3sin⁡1y = 2\cos 1 + 3\sin 1⁠, with 2cos⁡1≈1.0806046122\cos 1 \approx 1.080604612 and 3sin⁡1≈2.5244129543\sin 1 \approx 2.524412954⁠, so y≈3.605017566y \approx 3.605017566⁠, and the formula of Step 2 gives y′′≈−3.605017566y'' \approx -3.605017566⁠, and y′′+y=0y'' + y = 0⁠.

The curve itself agrees. With y(0.99)≈3.6054576570y(0.99) \approx 3.6054576570⁠, y(1)≈3.6050175662y(1) \approx 3.6050175662 and y(1.01)≈3.6042169766y(1.01) \approx 3.6042169766⁠, the second difference

y(1.01)−2y(1)+y(0.99)0.012≈−3.6050\begin{aligned} &\frac{y(1.01) - 2y(1) + y(0.99)}{0.01^2} \\ &\approx -3.6050 \end{aligned}

matches −y(1)≈−3.6050-y(1) \approx -3.6050 to four decimals (a step of 0.01 makes it an approximation).

Common mistakes
  1. Sign of (cos⁡x)′(\cos x)'⁠: it is −sin⁡x-\sin x⁠. Getting it wrong gives y′′=acos⁡x−bsin⁡xy'' = a\cos x - b\sin x⁠, and the check fails.
  2. Choosing values for aa and bb and checking only those. The question is about all real a,ba, b⁠, so keep them as letters.
  3. Substituting dydx\frac{dy}{dx} into an equation that does not contain it.
What to take away
  1. sin⁡x\sin x and cos⁡x\cos x each satisfy y′′=−yy'' = -y⁠, and so does any combination of them.
  2. Keep arbitrary constants as letters: one calculation then proves the whole family.
  3. Two constants for an order 2 equation: the count matches, as a general solution should.

Every fact used, and where it comes from

FactUsed inSource
(sin⁡x)′=cos⁡x(\sin x)' = \cos x⁠, (cos⁡x)′=−sin⁡x(\cos x)' = -\sin x⁠, constant multiple ruleSteps 1, 2Chapter 5 (Basics)
Second order derivativeStep 2Chapter 5, Section 5.7
A solution makes L.H.S. = R.H.S. when substitutedStep 3Section 9.3 (Lesson)
General solution: as many arbitrary constants as the order; particular: noneStep 4Section 9.3; chapter Summary (Basics)
y=asin⁡(x+b)y = a\sin(x + b) solves y′′+y=0y'' + y = 0Step 5Section 9.3, equations (3) and (4)
sin⁡(x+B)=sin⁡xcos⁡B+cos⁡xsin⁡B\sin(x + B) = \sin x\cos B + \cos x\sin BStep 5Class XI trigonometry
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 →