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

Exercise 9.5 · Q4: Linear: dydx+(sec⁡x)y=tan⁡x\frac{dy}{dx} + (\sec x)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:

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

Exam answer

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

I.F.=e∫sec⁡x dx=elog⁡(sec⁡x+tan⁡x)=sec⁡x+tan⁡x\begin{aligned} \text{I.F.} &= e^{\int\sec x\,dx} \\ &= e^{\log(\sec x + \tan x)} \\ &= \sec x + \tan x \end{aligned}

(sec⁡x+tan⁡x>0\sec x + \tan x > 0 for 0≤x<π20 \le x < \frac{\pi}{2}⁠.) So the solution is given by

y(sec⁡x+tan⁡x)=∫tan⁡x(sec⁡x+tan⁡x) dx+C=∫(sec⁡xtan⁡x+tan⁡2x) dx+C\begin{aligned} &y(\sec x + \tan x) \\ &= \int\tan x(\sec x + \tan x)\,dx \\ &\qquad + C \\ &= \int(\sec x\tan x + \tan^2x)\,dx \\ &\qquad + C \end{aligned}

Using tan⁡2x=sec⁡2x−1\tan^2x = \sec^2x - 1⁠,

y(sec⁡x+tan⁡x)=∫(sec⁡xtan⁡x+sec⁡2x−1) dx+C\begin{aligned} &y(\sec x + \tan x) \\ &= \int(\sec x\tan x + \sec^2x - 1)\,dx \\ &\qquad + C \end{aligned}

∴\therefore y(sec⁡x+tan⁡x)y(\sec x + \tan x) =sec⁡x+tan⁡x−x+C= \sec x + \tan x - x + C is the general solution.

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

The one idea this problem is built on

The equation is linear with P=sec⁡xP = \sec x⁠, so the integrating factor is e∫sec⁡x dx=sec⁡x+tan⁡xe^{\int\sec x\,dx} = \sec x + \tan x⁠, using the standard integral ∫sec⁡x dx=log⁡∣sec⁡x+tan⁡x∣\int\sec x\,dx = \log|\sec x + \tan x|⁠. After multiplying, the right side is sec⁡xtan⁡x+tan⁡2x\sec x\tan x + \tan^2x⁠; writing tan⁡2x=sec⁡2x−1\tan^2x = \sec^2x - 1 turns it into three standard integrals.

Given, to find, and the plan
Given
dydx+(sec⁡x) y=tan⁡x\frac{dy}{dx} + (\sec x)\,y = \tan x⁠, for 0≤x<π20 \le x < \frac{\pi}{2}⁠.
To find
The general solution (one arbitrary constant).
Plan
(1) Read off PP and QQ⁠. (2) I.F. =e∫sec⁡x dx= e^{\int\sec x\,dx}⁠; check the sign of sec⁡x+tan⁡x\sec x + \tan x on the interval. (3) Multiply and see the product rule. (4) Integrate, using tan⁡2x=sec⁡2x−1\tan^2x = \sec^2x - 1⁠. (5) Check by substitution.

Basics you need

1First order linear equations

dydx+Py=Q\frac{dy}{dx} + Py = Q⁠, where PP and QQ are constants or functions of xx only. Its solution is y (I.F.)=∫(Q×I.F.) dx+Cy\,(\text{I.F.}) = \int(Q\times\text{I.F.})\,dx + C⁠, where I.F.=e∫P dx\text{I.F.} = e^{\int P\,dx} (Section 9.4.3). Lesson: linear equations, the integrating factor

2∫sec⁡x dx=log⁡∣sec⁡x+tan⁡x∣+C\int\sec x\,dx = \log|\sec x + \tan x| + C

A standard integral (Section 7.3.1). And elog⁡t=te^{\log t} = t for t>0t > 0⁠. Basics: exponentials

3Standard integrals and an identity

∫sec⁡xtan⁡x dx=sec⁡x\int\sec x\tan x\,dx = \sec x⁠, ∫sec⁡2x dx=tan⁡x\int\sec^2x\,dx = \tan x (Section 7.2, formulas (vi) and (iv)); 1+tan⁡2x=sec⁡2x1 + \tan^2x = \sec^2x⁠. Basics: every method ends with an integral

4Why the I.F. works

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

Solution

  1. Recognise the linear form: P=sec⁡xP = \sec x⁠, Q=tan⁡xQ = \tan x

    The equation already has the form dydx+Py=Q\frac{dy}{dx} + Py = Q with P=sec⁡xP = \sec x and Q=tan⁡xQ = \tan x⁠.

    yy and dydx\frac{dy}{dx} appear to the first power, and PP⁠, QQ depend on xx only. Both are defined on 0≤x<π20 \le x < \frac{\pi}{2}⁠, where cos⁡x>0\cos x > 0⁠; the interval stops before π2\frac{\pi}{2}⁠, where sec⁡x\sec x and tan⁡x\tan x are undefined.
    Section 9.4.3, step (i). Lesson: linear equations
  2. The integrating factor: sec⁡x+tan⁡x\sec x + \tan x

    I.F.=e∫sec⁡x dx=elog⁡∣sec⁡x+tan⁡x∣=sec⁡x+tan⁡x.\begin{aligned} \text{I.F.} &= e^{\int\sec x\,dx} \\ &= e^{\log|\sec x + \tan x|} \\ &= \sec x + \tan x. \end{aligned}
    On 0≤x<π20 \le x < \frac{\pi}{2}⁠, sec⁡x≥1\sec x \ge 1 and tan⁡x≥0\tan x \ge 0⁠, so sec⁡x+tan⁡x≥1>0\sec x + \tan x \ge 1 > 0 and the modulus can be dropped; then elog⁡t=te^{\log t} = t⁠.
    Section 9.4.3, step (ii); Section 7.3.1. Basics: exponentials
  3. Multiply by sec⁡x+tan⁡x\sec x + \tan x⁠: the left side is one derivative

    (sec⁡x+tan⁡x)dydx+sec⁡x(sec⁡x+tan⁡x) y=tan⁡x(sec⁡x+tan⁡x),\begin{aligned} &(\sec x + \tan x)\frac{dy}{dx} \\ &\quad + \sec x(\sec x + \tan x)\,y \\ &= \tan x(\sec x + \tan x), \end{aligned}

    that is,

    ddx[y(sec⁡x+tan⁡x)]=sec⁡xtan⁡x+tan⁡2x.\begin{aligned} &\frac{d}{dx}\big[y(\sec x + \tan x)\big] \\ &= \sec x\tan x + \tan^2x. \end{aligned}
    The derivative of sec⁡x+tan⁡x\sec x + \tan x is sec⁡xtan⁡x+sec⁡2x\sec x\tan x + \sec^2x =sec⁡x(tan⁡x+sec⁡x)= \sec x(\tan x + \sec x)⁠, so by the product rule ddx[y(sec⁡x+tan⁡x)]\frac{d}{dx}\big[y(\sec x + \tan x)\big] is exactly the left side.
    Product rule (Chapter 5, Section 5.3). Basics: (y · g)′ = g(y′ + Py)
  4. Integrate, with one constant

    y(sec⁡x+tan⁡x)=∫(sec⁡xtan⁡x+tan⁡2x) dx+C=∫(sec⁡xtan⁡x+sec⁡2x−1) dx+C=sec⁡x+tan⁡x−x+C.\begin{aligned} &y(\sec x + \tan x) \\ &= \int(\sec x\tan x + \tan^2x)\,dx \\ &\qquad + C \\ &= \int(\sec x\tan x + \sec^2x - 1)\,dx \\ &\qquad + C \\ &= \sec x + \tan x - x + C. \end{aligned}
    This is y (I.F.)=∫(Q×I.F.) dx+Cy\,(\text{I.F.}) = \int(Q\times\text{I.F.})\,dx + C⁠. The identity tan⁡2x=sec⁡2x−1\tan^2x = \sec^2x - 1 replaces tan⁡2x\tan^2x⁠, which has no formula of its own in the list, by two standard integrands. Then term by term: ∫sec⁡xtan⁡x dx=sec⁡x\int\sec x\tan x\,dx = \sec x⁠, ∫sec⁡2x dx=tan⁡x\int\sec^2x\,dx = \tan x⁠, ∫1 dx=x\int 1\,dx = x⁠. Check: ddx(sec⁡x+tan⁡x−x)\frac{d}{dx}(\sec x + \tan x - x) =sec⁡xtan⁡x+sec⁡2x−1= \sec x\tan x + \sec^2x - 1⁠.
    Section 9.4.3, step (iii); Section 7.2, formulas (vi) and (iv). Basics: every method ends with an integral
  5. The general solution, and yy on its own

    y(sec⁡x+tan⁡x)=sec⁡x+tan⁡x−x+C.\begin{aligned} &y(\sec x + \tan x) \\ &= \sec x + \tan x - x + C. \end{aligned}

    Dividing by sec⁡x+tan⁡x\sec x + \tan x (positive), y=1+C−xsec⁡x+tan⁡xy = 1 + \dfrac{C - x}{\sec x + \tan x}⁠.

    The book leaves the answer in the first form, y (I.F.)=…y\,(\text{I.F.}) = \ldots⁠; the second form is the same equation solved for yy⁠, and it is the one used in the check.
    Section 9.4.3: the general solution. Lesson: Exercise 9.5 player
  6. Check by substituting back

    Write g=sec⁡x+tan⁡xg = \sec x + \tan x⁠, so g′=sec⁡x⋅gg' = \sec x\cdot g and 1g=sec⁡x−tan⁡x\frac{1}{g} = \sec x - \tan x (because sec⁡2x−tan⁡2x=1\sec^2x - \tan^2x = 1⁠). From y=1+(C−x)1gy = 1 + (C - x)\frac{1}{g}⁠:

    dydx=−1g−(C−x)g′g2=−1g−(C−x)sec⁡xg,(sec⁡x) y=sec⁡x+(C−x)sec⁡xg.\begin{aligned} \frac{dy}{dx} &= -\frac{1}{g} - (C - x)\frac{g'}{g^2} \\ &= -\frac{1}{g} - \frac{(C - x)\sec x}{g}, \\ (\sec x)\,y &= \sec x + \frac{(C - x)\sec x}{g}. \end{aligned}

    Adding,

    dydx+(sec⁡x) y=sec⁡x−1g=sec⁡x−(sec⁡x−tan⁡x)=tan⁡x,\begin{aligned} &\frac{dy}{dx} + (\sec x)\,y \\ &= \sec x - \frac{1}{g} \\ &= \sec x - (\sec x - \tan x) \\ &= \tan x, \end{aligned}

    for every CC⁠.

    The CC terms cancel, and what is left is sec⁡x−1sec⁡x+tan⁡x\sec x - \frac{1}{\sec x + \tan x}⁠, which equals tan⁡x\tan x because (sec⁡x+tan⁡x)(sec⁡x−tan⁡x)(\sec x + \tan x)(\sec x - \tan x) =sec⁡2x−tan⁡2x=1= \sec^2x - \tan^2x = 1⁠.
    A solution makes L.H.S. = R.H.S. (Section 9.3); quotient rule (Chapter 5). Lesson: general and particular solutions
Result

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

Check it with numbers

Take C=1C = 1 and x=0.5x = 0.5⁠: sec⁡0.5≈1.1394939\sec 0.5 \approx 1.1394939⁠, tan⁡0.5≈0.5463025\tan 0.5 \approx 0.5463025⁠, so sec⁡x+tan⁡x≈1.6857964\sec x + \tan x \approx 1.6857964 and y=1+0.51.6857964≈1.2965957y = 1 + \frac{0.5}{1.6857964} \approx 1.2965957⁠. The equation says dydx=tan⁡x−ysec⁡x≈−0.9311605\frac{dy}{dx} = \tan x - y\sec x \approx -0.9311605⁠.

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

1.2956653342−1.29752765560.002≈−0.93116.\begin{aligned} &\frac{1.2956653342 - 1.2975276556}{0.002} \\ &\approx -0.93116. \end{aligned}
Common mistakes
  1. Writing ∫sec⁡x dx=log⁡sec⁡x\int\sec x\,dx = \log\sec x or sec⁡xtan⁡x\sec x\tan x⁠; it is log⁡∣sec⁡x+tan⁡x∣\log|\sec x + \tan x|⁠.
  2. Leaving ∫tan⁡2x dx\int\tan^2x\,dx as tan⁡3x3\frac{\tan^3x}{3}: that is not its antiderivative. Use tan⁡2x=sec⁡2x−1\tan^2x = \sec^2x - 1⁠.
  3. Forgetting the −x-x from ∫(−1) dx\int(-1)\,dx⁠.
What to take away
  1. P=sec⁡xP = \sec x gives the I.F. sec⁡x+tan⁡x\sec x + \tan x⁠; P=tan⁡xP = \tan x gives sec⁡x\sec x⁠.
  2. Check the sign of what is inside log⁡∣…∣\log|\ldots| on the given interval before dropping the modulus.
  3. Square of a trigonometric function in an integral: turn it into a standard form with an identity.

Every fact used, and where it comes from

FactUsed inSource
Linear equation; 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, 2, 4Section 9.4.3, steps (i) to (iii) (Lesson)
∫sec⁡x dx=log⁡∣sec⁡x+tan⁡x∣+C\int\sec x\,dx = \log|\sec x + \tan x| + CStep 2Section 7.3.1 (Basics)
Product rule; ddxsec⁡x=sec⁡xtan⁡x\frac{d}{dx}\sec x = \sec x\tan x⁠, ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2xSteps 3, 6Chapter 5, Section 5.3 (Basics)
∫sec⁡xtan⁡x dx=sec⁡x+C\int\sec x\tan x\,dx = \sec x + C⁠; ∫sec⁡2x dx=tan⁡x+C\int\sec^2x\,dx = \tan x + CStep 4Section 7.2, formulas (vi) and (iv) (Basics)
1+tan⁡2x=sec⁡2x1 + \tan^2x = \sec^2xSteps 4, 6Class XI, Trigonometric Functions
Substituting back into the equationStep 6Section 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 →