IB Analysis and Approaches HL · Integral calculus · Section 7 of 13
Linear first-order differential equations
3 worked examples · By Álvaro López
Key idea
A first-order linear equation, dxdy+P(x)y=Q(x), cannot be separated, but if you multiply it by the integrating factor the left-hand side becomes the derivative of a product, and it is enough to integrate. This is HL content and appears in extended-response questions, often with an initial condition.
The standard form
The integrating factor
The idea is to look for a function μ(x) such that μy′+μPy is the derivative of μy. As (μy)′=μ′y+μy′, we need μ′=μP, and this is satisfied by μ=e∫Pdx.
To find μ you need only one antiderivative of P: no constant is needed, because any multiplicative constant in μ cancels in the formula.
A very useful trick: elng(x)=g(x), so if ∫P=ln∣g∣ the integrating factor is directly g (or ∣g∣, with the appropriate sign).
Worked examples
Example 1★ Basic
Constant coefficients
Solve dxdy+2y=6 given that y=1 when x=0.
Solution
Here P=2 and Q=6. The integrating factor is μ=e∫2dx=e2x. Multiply:
dxd(ye2x)=6e2x⇒ye2x=3e2x+C.
Divide by e2x: y=3+Ce−2x. With y=1 at x=0: 1=3+C, so C=−2.
y=3−2e−2x.
Example 2★★ Medium
Writing in standard form first
Solve xdxdy+2y=4x, for x>0, given that y=35 when x=1.
Solution
Divide by x to have coefficient 1 on y′: dxdy+x2y=4. Then P=x2 and Q=4.
Integrating factor: μ=e∫x2dx=e2lnx=x2. Multiply:
dxd(x2y)=4x2⇒x2y=34x3+C⇒y=34x+x2C.
With y=35 at x=1: 35=34+C, so C=31.
y=34x+3x21.
Example 3★★★ Hard
With a trigonometric function
Consider the differential equation
dxdy+ytanx=cos2x,−2π<x<2π,
with y=2 when x=0.
a) Find the integrating factor.
b) Find the general solution.
c) Find the particular solution and calculate y(3π).
Solution
a) Here P=tanx, and ∫tanxdx=−ln∣cosx∣. As cosx>0 on the interval,
μ=e−lncosx=cosx1.
b) Multiply by μ: dxd(cosxy)=cosxcos2x=cosx. Integrate:
cosxy=sinx+C⇒y=sinxcosx+Ccosx.
c) With y=2 at x=0: 2=0+C⋅1, so C=2 and
y=sinxcosx+2cosx.
For x=3π: y=23⋅21+2⋅21=43+1.
In the exam: marks are given for writing down μ and recognising that μy has derivative μQ. Do not forget to divide the constant by μ when solving for y: here C ends up multiplied by cosx.
Common mistakes
Summary
Standard form: dxdy+P(x)y=Q(x) (coefficient 1 on y′).
Integrating factor: μ=e∫Pdx (one antiderivative is enough, with no constant).
Multiplying: (μy)′=μQ, and therefore y=μ1(∫μQdx+C).
Divide the constant by μ too, and apply the initial condition at the end.