Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

It can be hard to find y1y_1 and y2y_2 in general, but some techniques can help. We will learn how to get y2y_2 if a y1y_1 is found (e.g, by guessing).

For example, to solve:

(x2x)yxy+y=0(x^2 - x)y'' - xy' + y = 0

We can guess that y1=xy_1 = x is a solution because y1=1y_1' = 1 and y1=0y_1'' = 0. We can now use reduction of order to find y2y_2. First, rewrite the ODE in standard form by dividing through by x2xx^2-x:

y+11xy+1x2xy=0y'' + \frac{1}{1 - x} y' + \frac{1}{x^2 - x}y = 0

Then, calculate u:

u=1x2exp(11xd ⁣x)=1x2 eln(1x)=1xx2\begin{align} u &= \frac{1}{x^2} \exp\left(-\int \frac{1}{1-x} \d{x} \right) \\ &= \frac{1}{x^2}\ e^{\ln(1-x)} \\ &= \frac{1-x}{x^2} \end{align}

Finally, integrate u to obtain y2y_2:

y2=1x2(1x21x)d ⁣x=x(1xlnx)\begin{align} y_2 &= \frac{1}{x^2} \int \left( \frac{1}{x^2} - \frac{1}{x} \right)\d{x} \\ &= x \left(-\frac{1}{x}-\ln{x}\right) \end{align}

Absorbing the minus sign into the unknown coefficient, the general solution is:

y=c1x+c2(1+lnx)y = c_1 x + c_2 (1 + \ln x)

Skill builder problems

Solve the following:

Solution to Exercise 1

Rearrange in standard form:

y+2xy+y=0y'' + \frac{2}{x}y' + y = 0

This ODE is linear and homogeneous, so use reduction of order for y2y_2. First compute u:

u=1y12epd ⁣x=x2cos2xexp(2xd ⁣x)=x2cos2xexp(2ln(x))=x2cos2xx2=sec2x\begin{align} u &= \frac{1}{y_1^2}e^{-\int p \d{x}} \\ &= \frac{x^2}{\cos^2 x} \exp\left(-\int \frac{2}{x} \d{x}\right) \\ &= \frac{x^2}{\cos^2 x} \exp\left(-2\ln(x)\right) \\ &= \frac{x^2}{\cos^2 x}x^{-2} \\ &= \sec^2 x \end{align}

Then compute y2y_2:

y2=y1ud ⁣x=cosxxsec2xd ⁣x=x1cosxtanx=sinxx\begin{align} y_{2} &= y_{1} \int u \d{x} \\ &= \frac{\cos x}{x} \int \sec^2 x \d{x} \\ &= x^{-1}\cos x \tan x \\ &= \frac{\sin x}{x} \end{align}

Hence, the general solution is:

y=c1cosxx+c2sinxxy = c_{1}\frac{\cos x}{x} + c_{2}\frac{\sin x}{x}
Solution to Exercise 2

By inspection y1=xy_{1} = x is a solution because y1=1y_{1}' = 1 and y1=0y_{1}'' = 0. So, find y2y_{2} using reduction of order. The standard form of the ODE is:

y2x1x2y+21x2y=0y'' - \frac{2x}{1-x^2}y' + \frac{2}{1-x^2}y = 0

Now compute u

u=1y22epd ⁣x=1x2exp(2x1x2d ⁣x)=1x2exp[ln(1x2)]=1x2(1x2)\begin{align} u &= \frac{1}{y_{2}^2}e^{-\int p \d{x}} \\ &= \frac{1}{x^2} \exp\left(\int \frac{2x}{1-x^2} \d{x}\right) \\ &= \frac{1}{x^2} \exp\left[-\ln(1 - x^2)\right] \\ &= \frac{1}{x^2(1 - x^2)} \end{align}

Then y2y_2:

y2=y1ud ⁣x=x1x2(1x2)d ⁣x\begin{align} y_{2} &= y_{1} \int u \d{x} \\ &= x \int \frac{1}{x^2(1 - x^2)} \d{x} \end{align}

Use partial-fraction decomposition to evaluate the integral:

1x2(1x)(1+x)=Ax+Bx2+C1+x+D1x\frac{1}{x^2(1 - x)(1 + x)} = \frac{A}{x} + \frac{B}{x^2} + \frac{C}{1 + x} + \frac{D}{1 - x}

Use the coverup method to get B=1B = 1, C=1/2C = 1/2, and D=1/2D = 1/2. Cross multiplying and collecting terms shows that A=0A = 0. So,

y2=x[1x2+12(1+x)+12(1x)]d ⁣x=x[1x+12ln(1+x)12ln(1x)]=1x2ln(1x1+x)\begin{align} y_2 &= x \int \left[ \frac{1}{x^2} + \frac{1}{2(1 + x)} + \frac{1}{2(1 - x)} \right] \d{x} \\ &= x \left[ -\frac{1}{x} + \frac{1}{2}\ln(1 + x) - \frac{1}{2}\ln(1 - x) \right] \\ &= -1 - \frac{x}{2} \ln \left( \frac{1 - x}{1 + x} \right) \end{align}

Hence, the general solution is:

y=c1x+c2[1+x2ln(1x1+x)]y = c_{1}x + c_{2} \left[ 1 + \frac{x}{2} \ln \left( \frac{1 - x}{1 + x} \right) \right]