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

Exercise 9.5 · Q5: Linear: cos⁡2xdydx+y=tan⁡x\cos^2x\frac{dy}{dx} + y = \tan x

Exercise 9.5Linear differential equations · Section 9.4.3
The question

For each of the differential equations given in Exercises 1 to 12, find the general solution:

5. cos⁡2x dydx+y=tan⁡x (0≤x<π2)\cos^2x\,\dfrac{dy}{dx} + y = \tan x\ \left(0 \le x < \dfrac{\pi}{2}\right)

Exam answer

Dividing both sides by cos⁡2x\cos^2x (≠0)(\ne 0)⁠,

dydx+sec⁡2x⋅y=sec⁡2xtan⁡x\frac{dy}{dx} + \sec^2x\cdot y = \sec^2x\tan x

This is of the form dydx+Py=Q\frac{dy}{dx} + Py = Q⁠, where P=sec⁡2xP = \sec^2x and Q=sec⁡2xtan⁡xQ = \sec^2x\tan x⁠.

I.F.=e∫sec⁡2x dx=etan⁡x\text{I.F.} = e^{\int\sec^2x\,dx} = e^{\tan x}

So the solution is given by

yetan⁡x=∫sec⁡2xtan⁡x etan⁡x dx+C…(i)\begin{aligned} ye^{\tan x} &= \int\sec^2x\tan x\,e^{\tan x}\,dx \\ &\qquad + C\quad\ldots(\text{i}) \end{aligned}

Put tan⁡x=t\tan x = t⁠. Then sec⁡2x dx=dt\sec^2x\,dx = dt⁠.

∫sec⁡2xtan⁡x etan⁡x dx=∫t et dt\int\sec^2x\tan x\,e^{\tan x}\,dx = \int t\,e^t\,dt

Integrating by parts with tt as the first function,

∫t et dt=t et−∫1⋅et dt=t et−et=et(t−1)=etan⁡x(tan⁡x−1)\begin{aligned} \int t\,e^t\,dt &= t\,e^t - \int 1\cdot e^t\,dt \\ &= t\,e^t - e^t = e^t(t - 1) \\ &= e^{\tan x}(\tan x - 1) \end{aligned}

Putting this in (i),

yetan⁡x=etan⁡x(tan⁡x−1)+C\begin{aligned} ye^{\tan x} &= e^{\tan x}(\tan x - 1) \\ &\quad + C \end{aligned}

Dividing by etan⁡xe^{\tan x}⁠,

∴\therefore y=(tan⁡x−1)+Ce−tan⁡xy = (\tan x - 1) + Ce^{-\tan x} is the general solution.

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

The one idea this problem is built on

The coefficient of dydx\frac{dy}{dx} is cos⁡2x\cos^2x⁠, not 1, so first divide by cos⁡2x\cos^2x (positive on the given interval). Then P=sec⁡2xP = \sec^2x⁠, whose integral is tan⁡x\tan x⁠, so the integrating factor is etan⁡xe^{\tan x}⁠. The integral that remains has tan⁡x\tan x and its derivative sec⁡2x\sec^2x side by side, so t=tan⁡xt = \tan x turns it into ∫t et dt\int t\,e^t\,dt⁠, done by parts, as in Example 22.

Given, to find, and the plan
Given
cos⁡2x dydx+y=tan⁡x\cos^2x\,\frac{dy}{dx} + y = \tan x⁠, for 0≤x<π20 \le x < \frac{\pi}{2}⁠.
To find
The general solution (one arbitrary constant).
Plan
(1) Divide by cos⁡2x\cos^2x to reach dydx+Py=Q\frac{dy}{dx} + Py = Q⁠. (2) Read off PP⁠, QQ⁠. (3) I.F. =e∫P dx= e^{\int P\,dx}⁠. (4) Multiply and integrate, with one constant. (5) Find the integral with t=tan⁡xt = \tan x and by parts. (6) Solve for yy⁠. (7) Check.

Basics you need

1The standard linear form

dydx+Py=Q\frac{dy}{dx} + Py = Q with PP⁠, QQ functions of xx only; the coefficient of dydx\frac{dy}{dx} must be 1 before PP is read off. Solution: y (I.F.)=∫(Q×I.F.) dx+Cy\,(\text{I.F.}) = \int(Q\times\text{I.F.})\,dx + C⁠, I.F.=e∫P dx\text{I.F.} = e^{\int P\,dx} (Section 9.4.3). Lesson: linear equations, the integrating factor

2Trigonometric facts

1cos⁡2x=sec⁡2x\frac{1}{\cos^2x} = \sec^2x⁠; ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2x⁠, so ∫sec⁡2x dx=tan⁡x+C\int\sec^2x\,dx = \tan x + C (Section 7.2, formula (iv)). Basics: derivatives

3Substitution, then by parts

With t=tan⁡xt = \tan x⁠, dt=sec⁡2x dxdt = \sec^2x\,dx (Section 7.3.1); then ∫t et dt\int t\,e^t\,dt by parts with tt first (Section 7.6). Basics: every method ends with an integral

4Why the I.F. works

g=etan⁡xg = e^{\tan x} has g′=sec⁡2x⋅gg' = \sec^2x\cdot g⁠, so g y′+sec⁡2x⋅g y=(yg)′g\,y' + \sec^2x\cdot g\,y = (yg)'⁠. Basics: (y · g)′ = g(y′ + Py)

Solution

  1. Divide by cos⁡2x\cos^2x to reach the standard form

    dydx+sec⁡2x⋅y=sec⁡2xtan⁡x.\frac{dy}{dx} + \sec^2x\cdot y = \sec^2x\tan x.
    The standard form needs dydx\frac{dy}{dx} with coefficient 1. On 0≤x<π20 \le x < \frac{\pi}{2}⁠, cos⁡x>0\cos x > 0⁠, so cos⁡2x≠0\cos^2x \ne 0 and dividing is allowed; 1cos⁡2x=sec⁡2x\frac{1}{\cos^2x} = \sec^2x and tan⁡xcos⁡2x=sec⁡2xtan⁡x\frac{\tan x}{\cos^2x} = \sec^2x\tan x⁠.
    Section 9.4.3, step (i). Lesson: linear equations
  2. Read off PP and QQ

    P=sec⁡2xP = \sec^2x and Q=sec⁡2xtan⁡xQ = \sec^2x\tan x⁠.

    Both depend on xx only, and yy appears to the first power, so the equation is linear.
    Section 9.4.3: PP and QQ are constants or functions of xx only. Lesson: linear equations
  3. The integrating factor: etan⁡xe^{\tan x}

    I.F.=e∫sec⁡2x dx=etan⁡x.\text{I.F.} = e^{\int\sec^2x\,dx} = e^{\tan x}.
    ∫sec⁡2x dx=tan⁡x\int\sec^2x\,dx = \tan x (any one antiderivative will do). No modulus appears here, because the antiderivative is not a logarithm.
    Section 9.4.3, step (ii); Section 7.2, formula (iv). Basics: exponentials
  4. Multiply and integrate, with one constant

    ddx(yetan⁡x)=sec⁡2xtan⁡x etan⁡x,yetan⁡x=∫sec⁡2xtan⁡x etan⁡x dx+C.…(1)\begin{aligned} \frac{d}{dx}\left(ye^{\tan x}\right) &= \sec^2x\tan x\,e^{\tan x}, \\ ye^{\tan x} &= \int\sec^2x\tan x\,e^{\tan x}\,dx \\ &\qquad + C.\quad\ldots(1) \end{aligned}
    By the product rule, ddx(yetan⁡x)=etan⁡xdydx+y etan⁡xsec⁡2x\frac{d}{dx}\left(ye^{\tan x}\right) = e^{\tan x}\frac{dy}{dx} + y\,e^{\tan x}\sec^2x⁠, which is the left side times the I.F. Integrating gives y (I.F.)=∫(Q×I.F.) dx+Cy\,(\text{I.F.}) = \int(Q\times\text{I.F.})\,dx + C⁠; this CC is the one constant.
    Section 9.4.3, step (iii); product rule and chain rule (Chapter 5, Sections 5.3, 5.3.1). Basics: (y · g)′ = g(y′ + Py)
  5. The integral: t=tan⁡xt = \tan x⁠, then by parts

    Put tan⁡x=t\tan x = t⁠, so sec⁡2x dx=dt\sec^2x\,dx = dt⁠:

    ∫sec⁡2xtan⁡x etan⁡x dx=∫t et dt.\int\sec^2x\tan x\,e^{\tan x}\,dx = \int t\,e^t\,dt.

    By parts, with tt as the first function and ete^t as the second:

    ∫t et dt=t et−∫1⋅et dt=t et−et=et(t−1)=etan⁡x(tan⁡x−1).\begin{aligned} \int t\,e^t\,dt &= t\,e^t - \int 1\cdot e^t\,dt \\ &= t\,e^t - e^t = e^t(t - 1) \\ &= e^{\tan x}(\tan x - 1). \end{aligned}
    t=tan⁡xt = \tan x is a legitimate substitution on the interval (tan⁡x\tan x is differentiable there). In the by-parts step, tt is the algebraic factor, so it is the first function: its derivative is 1 and the new integral ∫et dt\int e^t\,dt is easy. Check: ddt[et(t−1)]=et(t−1)+et=t et\frac{d}{dt}\left[e^t(t - 1)\right] = e^t(t - 1) + e^t = t\,e^t⁠.
    Section 7.3.1 (substitution); Section 7.6 (by parts). Basics: every method ends with an integral
  6. Solve for yy

    Putting the integral into (1):

    yetan⁡x=etan⁡x(tan⁡x−1)+Cy=(tan⁡x−1)+Ce−tan⁡x.\begin{aligned} ye^{\tan x} &= e^{\tan x}(\tan x - 1) + C \\ y &= (\tan x - 1) + Ce^{-\tan x}. \end{aligned}
    Divide by etan⁡xe^{\tan x}⁠, which is never zero; Cetan⁡x=Ce−tan⁡x\frac{C}{e^{\tan x}} = Ce^{-\tan x}⁠.
    Section 9.4.3: the general solution. Lesson: Exercise 9.5 player
  7. Check by substituting back

    From y=tan⁡x−1+Ce−tan⁡xy = \tan x - 1 + Ce^{-\tan x}⁠: dydx=sec⁡2x−Csec⁡2x e−tan⁡x\frac{dy}{dx} = \sec^2x - C\sec^2x\,e^{-\tan x}⁠. Multiply by cos⁡2x\cos^2x (cos⁡2xsec⁡2x=1\cos^2x\sec^2x = 1⁠) and add yy⁠:

    cos⁡2xdydx+y=1−Ce−tan⁡x+tan⁡x−1+Ce−tan⁡x=tan⁡x,\begin{aligned} &\cos^2x\frac{dy}{dx} + y \\ &= 1 - Ce^{-\tan x} \\ &\quad + \tan x - 1 + Ce^{-\tan x} \\ &= \tan x, \end{aligned}

    for every CC⁠.

    Everything except tan⁡x\tan x cancels, so the family satisfies the given equation itself, not only the divided form.
    A solution makes L.H.S. = R.H.S. (Section 9.3); chain rule (Chapter 5, Section 5.3.1). Lesson: general and particular solutions
Result

The general solution is y=(tan⁡x−1)+Ce−tan⁡xy = (\tan x - 1) + Ce^{-\tan x}⁠, where CC is an arbitrary constant, for 0≤x<π20 \le x < \frac{\pi}{2}⁠. (Textbook answer: y=(tan⁡x−1)+Ce−tan⁡xy = (\tan x - 1) + Ce^{-\tan x}⁠.)

Check it with numbers

Take C=1C = 1 and x=0.5x = 0.5⁠: tan⁡0.5≈0.5463025\tan 0.5 \approx 0.5463025⁠, e−tan⁡0.5≈0.5790870e^{-\tan 0.5} \approx 0.5790870⁠, so y≈0.1253895y \approx 0.1253895⁠. With cos⁡20.5≈0.7701512\cos^2 0.5 \approx 0.7701512⁠, the equation says dydx=tan⁡x−ycos⁡2x≈0.5465329\frac{dy}{dx} = \frac{\tan x - y}{\cos^2x} \approx 0.5465329⁠.

The curve itself: y(0.501)≈0.1259368471y(0.501) \approx 0.1259368471 and y(0.499)≈0.1248437799y(0.499) \approx 0.1248437799⁠, so

0.1259368471−0.12484377990.002≈0.54653.\begin{aligned} &\frac{0.1259368471 - 0.1248437799}{0.002} \\ &\approx 0.54653. \end{aligned}
Common mistakes
  1. Reading P=1P = 1 straight from cos⁡2x dydx+y=tan⁡x\cos^2x\,\frac{dy}{dx} + y = \tan x⁠. Divide by cos⁡2x\cos^2x first: P=sec⁡2xP = \sec^2x⁠.
  2. Dividing only the left side: Q=tan⁡xcos⁡2x=sec⁡2xtan⁡xQ = \frac{\tan x}{\cos^2x} = \sec^2x\tan x⁠, not tan⁡x\tan x⁠.
  3. Choosing ete^t as the first function in ∫t et dt\int t\,e^t\,dt⁠; that makes the new integral harder.
  4. Writing +C+C instead of +Ce−tan⁡x+Ce^{-\tan x} after dividing by etan⁡xe^{\tan x}⁠.
What to take away
  1. First make the coefficient of dydx\frac{dy}{dx} equal to 1, dividing every term.
  2. P=f′(x)P = f'(x) gives the I.F. ef(x)e^{f(x)}⁠; here f=tan⁡xf = \tan x⁠.
  3. ∫f′(x) f(x) ef(x) dx\int f'(x)\,f(x)\,e^{f(x)}\,dx⁠: put t=f(x)t = f(x) to get ∫t et dt=et(t−1)\int t\,e^t\,dt = e^t(t - 1)⁠.

Every fact used, and where it comes from

FactUsed inSource
Standard linear form; I.F. =e∫P dx= e^{\int P\,dx}⁠; y (I.F.)=∫(Q×I.F.) dx+Cy\,(\text{I.F.}) = \int(Q\times\text{I.F.})\,dx + CSteps 1 to 4Section 9.4.3, steps (i) to (iii) (Lesson)
∫sec⁡2x dx=tan⁡x+C\int\sec^2x\,dx = \tan x + CStep 3Section 7.2, formula (iv) (Basics)
Product rule; chain rule for etan⁡xe^{\tan x}Steps 4, 7Chapter 5, Sections 5.3 and 5.3.1 (Basics)
Substitution t=tan⁡xt = \tan xStep 5Section 7.3.1 (Basics)
Integration by partsStep 5Section 7.6 (Basics)
Substituting back into the equationStep 7Section 9.3 (Lesson)
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 →