Differential EquationsNonhomogeneous and Higher-Order Equations2 of 4
Nonhomogeneous and Higher-Order Equations · 2

Variation of Parameters

We need a way to solve linear differential equations when we can't guess the form of the particular solution.

1

Why We Let the Parameters Vary

Suppose we want to solve the differential equation

y′′+y\displaystyle \unknown{y''} + \unknown{y} =sec⁡(t)\displaystyle = \force{\sec(t)}

For an equation like y′′+y=et\unknown{y''} + \unknown{y} = \force{e^t}, we can guess a particular solution of the form Aet\force{Ae^t} because the derivatives of et\force{e^t} repeat. Here, differentiating sec⁡(t)\force{\sec(t)} keeps producing new secant and tangent terms, so there is no finite guess to try. Instead, we build the solution directly from the homogeneous solutions y1=cos⁡(t)\famone{y_1} = \famone{\cos(t)} and y2=sin⁡(t)\famtwo{y_2} = \famtwo{\sin(t)}.

Why We Let the Parameters Vary
y′′+y=sec⁡(t)\htmlClass{lc-blue}{y''} + \htmlClass{lc-blue}{y} = \htmlClass{lc-green}{\sec(t)}
y=c1cos⁡(t)+c2sin⁡(t)\htmlClass{lc-blue}{y} = \htmlClass{lc-orange}{c_1\cos(t)} + \htmlClass{lc-violet}{c_2\sin(t)}
sec⁡(t)\htmlClass{lc-green}{\sec(t)}
π2\dfrac{\pi}{2}
t\htmlClass{lc-mute}{t}
y\htmlClass{lc-mute}{y}

Replacing the fixed constants c1\famone{c_1} and c2\famtwo{c_2} in the homogeneous solution with unknown functions u1(t)\famone{u_1(t)} and u2(t)\famtwo{u_2(t)} gives the form of our solution:

y=u1(t)⏟varyingparametersy1(t)+u2(t)⏟varyingparametersy2(t)\displaystyle \begin{aligned}\unknown{y} &= \underbrace{\famone{u_1(t)}}_{\substack{\text{varying} \\ \text{parameters}}} \famone{y_1(t)} + \underbrace{\famtwo{u_2(t)}}_{\substack{\text{varying} \\ \text{parameters}}} \famtwo{y_2(t)}\end{aligned}

With zero on the right-hand side, the solution stays on a single wave with fixed (c1,c2)(\famone{c_1}, \famtwo{c_2}). With sec⁡(t)\force{\sec(t)} pushing on the system, the solution moves from one wave to another as u1(t)\famone{u_1(t)} and u2(t)\famtwo{u_2(t)} change.

When an outside force pushes on the system, the solution moves from one unforced wave to a new one at every moment, so its wave weights trace a path instead of staying fixed.
2

The Free Condition and the 2×22 \times 2 System

We want to find two equations for the two unknown functions u1(t)\famone{u_1(t)} and u2(t)\famtwo{u_2(t)} in y=u1y1+u2y2\unknown{y} = \famone{u_1 y_1} + \famtwo{u_2 y_2}. Because we replaced a single unknown function y\unknown{y} with two unknown functions, we get to choose a second condition of our own to keep their second derivatives out of the equation.

The Free Condition and the 2×2 System
y=u1 y1+u2 y2y′′+y=sec⁡(t)u1, u2=  ?\displaystyle \begin{aligned}\unknown{y} &= \famone{u_1\,y_1} + \famtwo{u_2\,y_2} \\[4pt] \unknown{y''} + \unknown{y} &= \force{\sec(t)} \\[4pt] \famone{u_1},\ \famtwo{u_2} &= \;?\end{aligned}

Differentiating y=u1y1+u2y2\unknown{y} = \famone{u_1 y_1} + \famtwo{u_2 y_2} with the product rule splits the derivative y′\unknown{y'} into two groups:

y′=(u1y1′+u2y2′)⏟as if u1,u2 were constant+(u1′y1+u2′y2)⏟extra terms from u1,u2 changing\displaystyle \begin{aligned}\unknown{y'} &= \underbrace{(\famone{u_1 y_1'} + \famtwo{u_2 y_2'})}_{\text{as if } \famone{u_1}, \famtwo{u_2} \text{ were constant}} \\ &\quad + \underbrace{(\famone{u_1' y_1} + \famtwo{u_2' y_2})}_{\text{extra terms from } \famone{u_1}, \famtwo{u_2} \text{ changing}}\end{aligned}

Setting that second group to zero clears u1′\famone{u_1'} and u2′\famtwo{u_2'} out of y′\unknown{y'}. Then, when we find y′′\unknown{y''} and plug everything into the differential equation, all the u1\famone{u_1} and u2\famtwo{u_2} terms cancel out because y1\famone{y_1} and y2\famtwo{y_2} solve the homogeneous equation. That leaves a 2×22 \times 2 system for u1′\famone{u_1'} and u2′\famtwo{u_2'}:

u1′y1+u2′y2=0u1′y1′+u2′y2′=g(t)\displaystyle \begin{aligned} \famone{u_1' y_1} + \famtwo{u_2' y_2} &= 0 \\ \famone{u_1' y_1'} + \famtwo{u_2' y_2'} &= \force{g(t)} \end{aligned}

Geometrically, setting u1′y1+u2′y2=0\famone{u_1' y_1} + \famtwo{u_2' y_2} = 0 means that at each moment t0t_0, the solution curve y(t)\unknown{y(t)} has the exact same slope as the homogeneous wave u1(t0)y1(t)+u2(t0)y2(t)\famone{u_1(t_0)y_1(t)} + \famtwo{u_2(t_0)y_2(t)} it is currently passing through, rather than crossing it at an angle.

At any point, the frozen wave has the exact same slope as the solution curve only when the two extra derivative terms cancel to zero.
3

Solving y′′+y=sec⁡(t)\unknown{y''} + \unknown{y} = \force{\sec(t)} and the Wronskian

Now we can use the 2×22 \times 2 system to solve our original equation:

y′′+y\displaystyle \unknown{y''} + \unknown{y} =sec⁡(t)\displaystyle = \force{\sec(t)}
Solving y″ + y = sec(t) and the Wronskian
y′′+y\displaystyle \unknown{y''} + \unknown{y} =sec⁡(t)\displaystyle = \force{\sec(t)}
y1\displaystyle \famone{y_1} =cos⁡(t),y2\displaystyle = \famone{\cos(t)}, \quad \famtwo{y_2} =sin⁡(t)\displaystyle = \famtwo{\sin(t)}
u1′ y1+u2′ y2=0u1′ y1′+u2′ y2′=g(t)\displaystyle \begin{alignedat}{2} \famone{u_1'\,y_1} &{}+ \famtwo{u_2'\,y_2} &&{}= 0 \\ \famone{u_1'\,y_1'} &{}+ \famtwo{u_2'\,y_2'} &&{}= \force{g(t)} \end{alignedat}
y\displaystyle \unknown{y} =  ?\displaystyle = \;?
Text solution
1. Plug y1=cos⁡(t)\famone{y_1} = \famone{\cos(t)} and y2=sin⁡(t)\famtwo{y_2} = \famtwo{\sin(t)} into the 2×22 \times 2 systemPutting the homogeneous solutions in the top row and their derivatives in the bottom row turns the differential equation into two equations we can solve for u1′\famone{u_1'} and u2′\famtwo{u_2'}.
u1′cos⁡(t)+u2′sin⁡(t)=0−u1′sin⁡(t)+u2′cos⁡(t)=sec⁡(t)\displaystyle \begin{aligned} \famone{u_1' \cos(t)} + \famtwo{u_2' \sin(t)} &= 0 \\ \famone{-u_1' \sin(t)} + \famtwo{u_2' \cos(t)} &= \force{\sec(t)} \end{aligned}
2. Eliminate u1′\famone{u_1'} to solve for u2′\famtwo{u_2'} and u1′\famone{u_1'}Multiplying the top equation by sin⁡(t)\sin(t) and the bottom equation by cos⁡(t)\cos(t) makes the u1′\famone{u_1'} terms cancel when we add them, and substituting u2′=1\famtwo{u_2'} = 1 back into the top equation gives u1′\famone{u_1'}.
u2′(sin⁡2(t)+cos⁡2(t))=sec⁡(t)cos⁡(t)=1  ⟹  u2′=1u1′cos⁡(t)+(1)sin⁡(t)=0  ⟹  u1′=−sin⁡(t)cos⁡(t)=−tan⁡(t)\displaystyle \begin{aligned} \famtwo{u_2'}(\sin^2(t) + \cos^2(t)) &= \force{\sec(t)}\cos(t) \\ &= 1 \\ \implies \famtwo{u_2'} &= 1 \\ \famone{u_1' \cos(t)} + \famtwo{(1)\sin(t)} &= 0 \\ \implies \famone{u_1'} &= -\frac{\sin(t)}{\cos(t)} \\ &= -\tan(t) \end{aligned}
3. Integrate u1′\famone{u_1'} and u2′\famtwo{u_2'}Integrating each derivative with respect to tt gives the two functions u1(t)\famone{u_1(t)} and u2(t)\famtwo{u_2(t)}.
u1=∫−tan⁡(t) dt=ln⁡∣cos⁡(t)∣+c1u2=∫1 dt=t+c2\displaystyle \begin{aligned} \famone{u_1} &= \int -\tan(t)\,dt \\ &= \ln|\cos(t)| + \famone{c_1} \\ \famtwo{u_2} &= \int 1\,dt \\ &= t + \famtwo{c_2} \end{aligned}
4. Substitute u1\famone{u_1} and u2\famtwo{u_2} into y=u1cos⁡(t)+u2sin⁡(t)\unknown{y} = \famone{u_1 \cos(t)} + \famtwo{u_2 \sin(t)} and expandMultiplying out the terms separates the integration constants into the homogeneous solution and the remaining pieces into the particular solution.
y=(ln⁡∣cos⁡(t)∣+c1)cos⁡(t)+(t+c2)sin⁡(t)=c1cos⁡(t)+c2sin⁡(t)⏟homogeneous solution+cos⁡(t)ln⁡∣cos⁡(t)∣+tsin⁡(t)⏟particular solution\displaystyle \begin{aligned} \unknown{y} &= \famone{(\ln|\cos(t)| + c_1)\cos(t)} \\ &\quad + \famtwo{(t + c_2)\sin(t)} \\ &= \underbrace{\famone{c_1 \cos(t)} + \famtwo{c_2 \sin(t)}}_{\text{homogeneous solution}} \\ &\quad + \underbrace{\particular{\cos(t)\ln|\cos(t)| + t\sin(t)}}_{\particular{\text{particular solution}}} \end{aligned}
−π2-\tfrac{\pi}{2}
00
π2\tfrac{\pi}{2}
11
t\htmlClass{lc-mute}{t}
y\htmlClass{lc-mute}{y}
cos⁡(t)\htmlClass{lc-blue}{\cos(t)}
−π2-\tfrac{\pi}{2}
00
π2\tfrac{\pi}{2}
11
π2\tfrac{\pi}{2}
t\htmlClass{lc-mute}{t}
y\htmlClass{lc-mute}{y}
cos⁡(t)ln⁡∣cos⁡(t)∣+tsin⁡(t)\htmlClass{lc-green}{\cos(t)\ln|\cos(t)| + t\sin(t)}
sec⁡(t)→∞\htmlClass{lc-green}{\sec(t)} \to \infty
sec⁡(t)→∞\htmlClass{lc-green}{\sec(t)} \to \infty

Instead of solving the 2×22 \times 2 system by elimination each time, you can write the solution directly using Cramer's Rule, which puts the Wronskian determinant in the denominator:

W=∣y1y2y1′y2′∣=y1y2′−y2y1′⏟Wronskian\displaystyle \underbrace{W = \begin{vmatrix} \famone{y_1} & \famtwo{y_2} \\ \famone{y_1'} & \famtwo{y_2'} \end{vmatrix} = \famone{y_1} \famtwo{y_2'} - \famtwo{y_2} \famone{y_1'}}_{\text{Wronskian}}
u1′=∣0y2g(t)y2′∣W=−y2g(t)W,u2′=∣y10y1′g(t)∣W=y1g(t)W\displaystyle \begin{aligned} \famone{u_1'} &= \frac{\begin{vmatrix} 0 & \famtwo{y_2} \\ \force{g(t)} & \famtwo{y_2'} \end{vmatrix}}{W} = -\frac{\famtwo{y_2} \force{g(t)}}{W}, \\ \famtwo{u_2'} &= \frac{\begin{vmatrix} \famone{y_1} & 0 \\ \famone{y_1'} & \force{g(t)} \end{vmatrix}}{W} = \frac{\famone{y_1} \force{g(t)}}{W} \end{aligned}

Because y1\famone{y_1} and y2\famtwo{y_2} are linearly independent solutions of the homogeneous equation, WW is never zero. Solving the system by elimination and using the Wronskian formulas do the exact same algebra, so you can use whichever feels faster on a test.

4

Variable Coefficients and Dividing by the Leading Term

Now let's solve an equation with variable coefficients on the left-hand side for t>0t > 0, where the homogeneous solutions y1=t\famone{y_1} = \famone{t} and y2=t2\famtwo{y_2} = \famtwo{t^2} are given:

t2y′′−2ty′+2y\displaystyle t^2 \unknown{y''} - 2t\unknown{y'} + 2\unknown{y} =t3et\displaystyle = \force{t^3 e^t}

Even though every derivative of t3et\force{t^3 e^t} is a cubic times ete^t, we can't count on guessing a solution here: the powers of tt on the left-hand side raise the powers of tt in any guess, and undetermined coefficients is only guaranteed to work when the left-hand side has constant coefficients.

Variable Coefficients and Dividing by the Leading Term
t2y′′−2ty′+2y\displaystyle t^2\unknown{y''} - 2t\unknown{y'} + 2\unknown{y} =t3et\displaystyle = \force{t^3e^t}
t>0\displaystyle t > 0
y1\displaystyle \famone{y_1} =t,y2\displaystyle = \famone{t}, \quad \famtwo{y_2} =t2\displaystyle = \famtwo{t^2}
y\displaystyle \unknown{y} =  ?\displaystyle = \;?
Text solution
1. Divide the equation by t2t^2 so the coefficient of y′′\unknown{y''} is 11Dividing the whole equation by t2t^2 makes the coefficient of y′′\unknown{y''} equal to 11 and gives the right-hand side g(t)=tet\force{g(t)} = \force{te^t}.
y′′−2ty′+2t2y=tet⏟g(t)\displaystyle \begin{aligned}\unknown{y''} - \frac{2}{t}\unknown{y'} + \frac{2}{t^2}\unknown{y} &= \underbrace{\force{te^t}}_{\force{g(t)}}\end{aligned}
2. Set up the 2×22 \times 2 system and compute the Wronskian WWUsing the given homogeneous solutions y1=t\famone{y_1} = \famone{t} and y2=t2\famtwo{y_2} = \famtwo{t^2} with g(t)=tet\force{g(t)} = \force{te^t} gives the system and its Wronskian determinant WW.
u1′(t)+u2′(t2)=0u1′(1)+u2′(2t)=tetW=∣tt212t∣=2t2−t2=t2\displaystyle \begin{aligned} \famone{u_1'(t)} + \famtwo{u_2'(t^2)} &= 0 \\ \famone{u_1'(1)} + \famtwo{u_2'(2t)} &= \force{te^t} \\ W = \begin{vmatrix} \famone{t} & \famtwo{t^2} \\ \famone{1} & \famtwo{2t} \end{vmatrix} &= 2t^2 - t^2 = t^2 \end{aligned}
3. Find u1′\famone{u_1'} and u2′\famtwo{u_2'} from the Wronskian determinantsReplacing the first and second columns of WW with [0tet]\begin{bmatrix} 0 \\ \force{te^t} \end{bmatrix} and dividing by W=t2W = t^2 gives u1′\famone{u_1'} and u2′\famtwo{u_2'}.
u1′=∣0t2tet2t∣t2=−t3ett2=−tet,u2′=∣t01tet∣t2=t2ett2=et\displaystyle \begin{aligned} \famone{u_1'} &= \frac{\begin{vmatrix} 0 & \famtwo{t^2} \\ \force{te^t} & \famtwo{2t} \end{vmatrix}}{t^2} = \frac{-t^3 e^t}{t^2} = -te^t, \\ \famtwo{u_2'} &= \frac{\begin{vmatrix} \famone{t} & 0 \\ \famone{1} & \force{te^t} \end{vmatrix}}{t^2} = \frac{t^2 e^t}{t^2} = e^t \end{aligned}
4. Integrate u1′\famone{u_1'} and u2′\famtwo{u_2'}Integrating u1′=−tet\famone{u_1'} = -te^t by parts and u2′=et\famtwo{u_2'} = e^t directly gives the functions u1(t)\famone{u_1(t)} and u2(t)\famtwo{u_2(t)}.
u1=∫−tet dt=−tet+et+c1u2=∫et dt=et+c2\displaystyle \begin{aligned} \famone{u_1} &= \int -te^t\,dt = -te^t + e^t + \famone{c_1} \\ \famtwo{u_2} &= \int e^t\,dt = e^t + \famtwo{c_2} \end{aligned}
5. Substitute into y=u1t+u2t2\unknown{y} = \famone{u_1 t} + \famtwo{u_2 t^2} and cancel the ±t2et\pm t^2 e^t termsPlugging u1\famone{u_1} and u2\famtwo{u_2} back into the solution and multiplying out cancels −t2et-t^2 e^t with +t2et+t^2 e^t, leaving the general solution.
y=(−tet+et+c1)t+(et+c2)t2=−t2et+tet+c1t+t2et+c2t2=c1t+c2t2+tet\displaystyle \begin{aligned} \unknown{y} &= \famone{(-te^t + e^t + c_1)t} + \famtwo{(e^t + c_2)t^2} \\ &= -t^2 e^t + te^t + \famone{c_1 t} + t^2 e^t + \famtwo{c_2 t^2} \\ &= \famone{c_1 t} + \famtwo{c_2 t^2} + te^t \end{aligned}

Key concepts

Before using Variation of Parameters, check whether you need it: if the left-hand side has constant coefficients and the right-hand side's derivatives repeat or reach zero (such as y′′+y=et\unknown{y''} + \unknown{y} = \force{e^t} or y′′+y=t2\unknown{y''} + \unknown{y} = \force{t^2}), undetermined coefficients (guessing Aet\force{Ae^t} or a polynomial) is much faster. Use Variation of Parameters when the right-hand side has derivatives that never repeat or reach zero (like y′′+y=sec⁡(t)\unknown{y''} + \unknown{y} = \force{\sec(t)}), or when the left-hand side has variable coefficients (like t2y′′−2ty′+2y=t3ett^2 \unknown{y''} - 2t\unknown{y'} + 2\unknown{y} = \force{t^3 e^t}, where y1=t\famone{y_1} = \famone{t} and y2=t2\famtwo{y_2} = \famtwo{t^2} are given).

First check the coefficient of y′′\unknown{y''} and divide the equation by it so the equation has the form y′′+p(t)y′+q(t)y=g(t)\unknown{y''} + p(t)\unknown{y'} + q(t)\unknown{y} = \force{g(t)} (for t2y′′−2ty′+2y=t3ett^2 \unknown{y''} - 2t\unknown{y'} + 2\unknown{y} = \force{t^3 e^t}, dividing by t2t^2 makes g(t)=tet\force{g(t)} = \force{te^t}, not t3et\force{t^3 e^t}). Then write y=u1y1+u2y2\unknown{y} = \famone{u_1 y_1} + \famtwo{u_2 y_2} using the two homogeneous solutions y1,y2\famone{y_1}, \famtwo{y_2}, and solve the 2×22 \times 2 system for u1′\famone{u_1'} and u2′\famtwo{u_2'}:

u1′y1+u2′y2=0u1′y1′+u2′y2′=g(t)⟺u1′=−y2g(t)W,u2′=y1g(t)Wwhere W=∣y1y2y1′y2′∣\displaystyle \begin{gathered} \begin{aligned} \famone{u_1' y_1} + \famtwo{u_2' y_2} &= 0 \\ \famone{u_1' y_1'} + \famtwo{u_2' y_2'} &= \force{g(t)} \end{aligned} \\ \Longleftrightarrow \quad \begin{aligned} \famone{u_1'} &= -\frac{\famtwo{y_2} \force{g(t)}}{W}, \\ \famtwo{u_2'} &= \frac{\famone{y_1} \force{g(t)}}{W} \end{aligned} \\ \text{where } W = \begin{vmatrix} \famone{y_1} & \famtwo{y_2} \\ \famone{y_1'} & \famtwo{y_2'} \end{vmatrix} \end{gathered}

Finally, integrate u1′\famone{u_1'} and u2′\famtwo{u_2'} to get u1\famone{u_1} and u2\famtwo{u_2}, and plug them back into y=u1y1+u2y2\unknown{y} = \famone{u_1 y_1} + \famtwo{u_2 y_2}.

5

Practice

1

Solve y′′+4y=sec⁡(2t)\unknown{y''} + 4\unknown{y} = \force{\sec(2t)}.

Start with y′′+4y=0\unknown{y''} + 4\unknown{y} = 0: what two trig functions have a second derivative equal to −4-4 times themselves, and what factor comes out from the chain rule when you differentiate them for the bottom row of the system?

The homogeneous equation y′′+4y=0\unknown{y''} + 4\unknown{y} = 0 has solutions y1=cos⁡(2t)\famone{y_1} = \famone{\cos(2t)} and y2=sin⁡(2t)\famtwo{y_2} = \famtwo{\sin(2t)}, so y=u1cos⁡(2t)+u2sin⁡(2t)\unknown{y} = \famone{u_1 \cos(2t)} + \famtwo{u_2 \sin(2t)}.
Differentiating gives y1′=−2sin⁡(2t)\famone{y_1'} = \famone{-2\sin(2t)} and y2′=2cos⁡(2t)\famtwo{y_2'} = \famtwo{2\cos(2t)}, which gives the system and the Wronskian:
u1′cos⁡(2t)+u2′sin⁡(2t)=0−2u1′sin⁡(2t)+2u2′cos⁡(2t)=sec⁡(2t)W=∣cos⁡(2t)sin⁡(2t)−2sin⁡(2t)2cos⁡(2t)∣=2\displaystyle \begin{aligned} \famone{u_1' \cos(2t)} + \famtwo{u_2' \sin(2t)} &= 0 \\ \famone{-2u_1' \sin(2t)} + \famtwo{2u_2' \cos(2t)} &= \force{\sec(2t)} \\ W = \begin{vmatrix} \famone{\cos(2t)} & \famtwo{\sin(2t)} \\ \famone{-2\sin(2t)} & \famtwo{2\cos(2t)} \end{vmatrix} &= 2 \end{aligned}
(Watch out: forgetting the chain-rule factor of 22 in y1′\famone{y_1'} and y2′\famtwo{y_2'} gives W=1W = 1 instead of W=2W = 2, which leads to the common wrong answer y=c1cos⁡(2t)+c2sin⁡(2t)+12cos⁡(2t)ln⁡∣cos⁡(2t)∣+tsin⁡(2t)\unknown{y} = \famone{c_1 \cos(2t)} + \famtwo{c_2 \sin(2t)} + \frac{1}{2}\cos(2t)\ln|\cos(2t)| + t\sin(2t).)
Solving for u1′\famone{u_1'} and u2′\famtwo{u_2'} and integrating (keep track of the 12\tfrac{1}{2} from du=2 dtdu = 2\,dt in the tangent integral):
u1′=−sin⁡(2t)sec⁡(2t)2=−12tan⁡(2t)  ⟹  u1=∫−12tan⁡(2t) dt=14ln⁡∣cos⁡(2t)∣+c1u2′=cos⁡(2t)sec⁡(2t)2=12  ⟹  u2=∫12 dt=12t+c2\displaystyle \begin{aligned} \famone{u_1'} &= -\frac{\famtwo{\sin(2t)}\force{\sec(2t)}}{2} \\ &= -\frac{1}{2}\tan(2t) \\ \implies \famone{u_1} &= \int -\frac{1}{2}\tan(2t)\,dt \\ &= \frac{1}{4}\ln|\cos(2t)| + \famone{c_1} \\ \famtwo{u_2'} &= \frac{\famone{\cos(2t)}\force{\sec(2t)}}{2} = \frac{1}{2} \\ \implies \famtwo{u_2} &= \int \frac{1}{2}\,dt = \frac{1}{2}t + \famtwo{c_2} \end{aligned}
Plugging u1\famone{u_1} and u2\famtwo{u_2} into y=u1cos⁡(2t)+u2sin⁡(2t)\unknown{y} = \famone{u_1 \cos(2t)} + \famtwo{u_2 \sin(2t)} gives
y=c1cos⁡(2t)+c2sin⁡(2t)+14cos⁡(2t)ln⁡∣cos⁡(2t)∣+12tsin⁡(2t)\displaystyle \begin{aligned}\unknown{y} &= \famone{c_1 \cos(2t)} + \famtwo{c_2 \sin(2t)} \\ &\quad + \frac{1}{4} \cos(2t) \ln|\cos(2t)| \\ &\quad + \frac{1}{2}t \sin(2t)\end{aligned}
2

Solve y′′−2y′+y=et1+t2\unknown{y''} - 2\unknown{y'} + \unknown{y} = \force{\frac{e^t}{1 + t^2}}.

Factor the characteristic equation r2−2r+1=0r^2 - 2r + 1 = 0 for the homogeneous equation: when a root repeats, how do you write the second independent solution y2\famtwo{y_2}?

The homogeneous equation has characteristic equation (r−1)2=0(r - 1)^2 = 0, so y1=et\famone{y_1} = \famone{e^t} and y2=tet\famtwo{y_2} = \famtwo{te^t}. Using the product rule for y2′=(1+t)et\famtwo{y_2'} = \famtwo{(1 + t)e^t}, the Wronskian is
W=∣ettetet(1+t)et∣=(1+t)e2t−te2t=e2t\displaystyle W = \begin{vmatrix} \famone{e^t} & \famtwo{te^t} \\ \famone{e^t} & \famtwo{(1 + t)e^t} \end{vmatrix} = (1 + t)e^{2t} - te^{2t} = e^{2t}
With g(t)=et1+t2\force{g(t)} = \force{\frac{e^t}{1 + t^2}}, the derivatives u1′\famone{u_1'} and u2′\famtwo{u_2'} are
u1′=−tet⋅et1+t2e2t=−t1+t2,u2′=et⋅et1+t2e2t=11+t2\displaystyle \begin{aligned} \famone{u_1'} &= -\frac{\famtwo{te^t} \cdot \force{\frac{e^t}{1 + t^2}}}{e^{2t}} = -\frac{t}{1 + t^2}, \\ \famtwo{u_2'} &= \frac{\famone{e^t} \cdot \force{\frac{e^t}{1 + t^2}}}{e^{2t}} = \frac{1}{1 + t^2} \end{aligned}
(Watch out: when integrating u1′=−t1+t2\famone{u_1'} = -\frac{t}{1 + t^2} with u=1+t2u = 1 + t^2 and du=2t dtdu = 2t\,dt, forgetting to divide by 22 gives −ln⁡(1+t2)-\ln(1 + t^2) instead of −12ln⁡(1+t2)-\frac{1}{2}\ln(1 + t^2), which produces the wrong answer y=c1et+c2tet−etln⁡(1+t2)+tetarctan⁡(t)\unknown{y} = \famone{c_1 e^t} + \famtwo{c_2 te^t} - e^t \ln(1 + t^2) + te^t \arctan(t).)
Integrating both expressions gives
u1=∫−t1+t2 dt=−12ln⁡(1+t2)+c1u2=∫11+t2 dt=arctan⁡(t)+c2\displaystyle \begin{aligned} \famone{u_1} &= \int -\frac{t}{1 + t^2}\,dt \\ &= -\frac{1}{2}\ln(1 + t^2) + \famone{c_1} \\ \famtwo{u_2} &= \int \frac{1}{1 + t^2}\,dt \\ &= \arctan(t) + \famtwo{c_2} \end{aligned}
Substituting u1\famone{u_1} and u2\famtwo{u_2} into y=u1et+u2tet\unknown{y} = \famone{u_1 e^t} + \famtwo{u_2 te^t} gives
y\displaystyle \unknown{y} =c1et+c2tet−12etln⁡(1+t2)+tetarctan⁡(t)\displaystyle = \famone{c_1 e^t} + \famtwo{c_2 te^t} - \frac{1}{2}e^t \ln(1 + t^2) + te^t \arctan(t)
3

Solve t2y′′+ty′−y=t3t^2 \unknown{y''} + t\unknown{y'} - \unknown{y} = \force{t^3} for t>0t > 0, given that y1=t\famone{y_1} = \famone{t} and y2=1t\famtwo{y_2} = \famtwo{\tfrac{1}{t}} solve the homogeneous equation.

Look at the coefficient in front of y′′\unknown{y''}: what must you do to the equation before picking g(t)\force{g(t)} for the bottom row of your system?

Divide the entire equation by t2t^2 first so that y′′\unknown{y''} has a coefficient of 11:
y′′+1ty′−1t2y\displaystyle \unknown{y''} + \frac{1}{t}\unknown{y'} - \frac{1}{t^2}\unknown{y} =t  ⟹  g(t)\displaystyle = \force{t} \implies \force{g(t)} =t\displaystyle = \force{t}
(Watch out: using g(t)=t3\force{g(t)} = \force{t^3} without dividing by t2t^2 first makes u1′=12t3\famone{u_1'} = \frac{1}{2}t^3 and u2′=−12t5\famtwo{u_2'} = -\frac{1}{2}t^5, which leads to the wrong answer y=c1t+c2t+124t5\unknown{y} = \famone{c_1 t} + \famtwo{\tfrac{c_2}{t}} + \frac{1}{24}t^5.)
With y1=t\famone{y_1} = \famone{t} and y2=t−1\famtwo{y_2} = \famtwo{t^{-1}}, the Wronskian is
W=∣t1t1−1t2∣=−1t−1t=−2t\displaystyle W = \begin{vmatrix} \famone{t} & \famtwo{\tfrac{1}{t}} \\ \famone{1} & \famtwo{-\tfrac{1}{t^2}} \end{vmatrix} = -\frac{1}{t} - \frac{1}{t} = -\frac{2}{t}
Solving for u1′\famone{u_1'} and u2′\famtwo{u_2'} and integrating:
u1′=−(1t)(t)−2t=12t  ⟹  u1=∫12t dt=14t2+c1u2′=(t)(t)−2t=−12t3  ⟹  u2=∫−12t3 dt=−18t4+c2\displaystyle \begin{aligned} \famone{u_1'} &= -\frac{(\famtwo{\tfrac{1}{t}})(\force{t})}{-\tfrac{2}{t}} = \frac{1}{2}t \\ \implies \famone{u_1} &= \int \frac{1}{2}t\,dt = \frac{1}{4}t^2 + \famone{c_1} \\ \famtwo{u_2'} &= \frac{(\famone{t})(\force{t})}{-\tfrac{2}{t}} = -\frac{1}{2}t^3 \\ \implies \famtwo{u_2} &= \int -\frac{1}{2}t^3\,dt = -\frac{1}{8}t^4 + \famtwo{c_2} \end{aligned}
Plugging u1\famone{u_1} and u2\famtwo{u_2} into y=u1t+u2(1t)\unknown{y} = \famone{u_1 t} + \famtwo{u_2(\tfrac{1}{t})} and combining the t3t^3 terms gives
y=(14t2+c1)t+(−18t4+c2)1t=c1t+c2t+18t3\displaystyle \begin{aligned} \unknown{y} &= \famone{\left(\frac{1}{4}t^2 + c_1\right)t} + \famtwo{\left(-\frac{1}{8}t^4 + c_2\right)\frac{1}{t}} \\ &= \famone{c_1 t} + \famtwo{\frac{c_2}{t}} + \frac{1}{8}t^3 \end{aligned}
4

Solve ty′′−(1+t)y′+y=t2e2tt\unknown{y''} - (1 + t)\unknown{y'} + \unknown{y} = \force{t^2 e^{2t}} for t>0t > 0, given that y1=1+t\famone{y_1} = \famone{1 + t} and y2=et\famtwo{y_2} = \famtwo{e^t} solve the homogeneous equation.

Divide the equation to get y′′\unknown{y''} by itself first, then write out the Wronskian of y1=1+t\famone{y_1} = \famone{1 + t} and y2=et\famtwo{y_2} = \famtwo{e^t}. What simplifies when you subtract the two diagonal products?

Divide the entire equation by tt so the coefficient of y′′\unknown{y''} is 11:
y′′−1+tty′+1ty\displaystyle \unknown{y''} - \frac{1 + t}{t}\unknown{y'} + \frac{1}{t}\unknown{y} =te2t  ⟹  g(t)\displaystyle = \force{te^{2t}} \implies \force{g(t)} =te2t\displaystyle = \force{te^{2t}}
(Watch out: forgetting to divide by tt and putting g(t)=t2e2t\force{g(t)} = \force{t^2 e^{2t}} into the system leaves an extra factor of tt in both integrals, which leads to the wrong answer y=c1(1+t)+c2et+14(2t2−5t+5)e2t\unknown{y} = \famone{c_1(1 + t)} + \famtwo{c_2 e^t} + \frac{1}{4}(2t^2 - 5t + 5)e^{2t}.)
For y1=1+t\famone{y_1} = \famone{1 + t} and y2=et\famtwo{y_2} = \famtwo{e^t}, the Wronskian simplifies nicely:
W=∣1+tet1et∣=(1+t)et−et=tet\displaystyle W = \begin{vmatrix} \famone{1 + t} & \famtwo{e^t} \\ \famone{1} & \famtwo{e^t} \end{vmatrix} = (1 + t)e^t - e^t = te^t
Now find u1′\famone{u_1'} and u2′\famtwo{u_2'} and integrate (noticing for u2\famtwo{u_2} that (1+t)et(1 + t)e^t is the exact product-rule derivative of tette^t):
u1′=−et(te2t)tet=−e2t  ⟹  u1=∫−e2t dt=−12e2t+c1u2′=(1+t)(te2t)tet=(1+t)et  ⟹  u2=∫(1+t)et dt=tet+c2\displaystyle \begin{aligned} \famone{u_1'} &= -\frac{\famtwo{e^t}(\force{te^{2t}})}{te^t} = -e^{2t} \\ \implies \famone{u_1} &= \int -e^{2t}\,dt = -\frac{1}{2}e^{2t} + \famone{c_1} \\ \famtwo{u_2'} &= \frac{(\famone{1 + t})(\force{te^{2t}})}{te^t} = (1 + t)e^t \\ \implies \famtwo{u_2} &= \int (1 + t)e^t\,dt = te^t + \famtwo{c_2} \end{aligned}
Substituting u1\famone{u_1} and u2\famtwo{u_2} into y=u1(1+t)+u2et\unknown{y} = \famone{u_1(1 + t)} + \famtwo{u_2 e^t} and combining the e2te^{2t} terms gives
y=(−12e2t+c1)(1+t)+(tet+c2)et=c1(1+t)+c2et−12(1+t)e2t+te2t=c1(1+t)+c2et+12(t−1)e2t\displaystyle \begin{aligned} \unknown{y} &= \famone{\left(-\frac{1}{2}e^{2t} + c_1\right)(1 + t)} \\ &\quad + \famtwo{(te^t + c_2)e^t} \\ &= \famone{c_1(1 + t)} + \famtwo{c_2 e^t} \\ &\quad - \frac{1}{2}(1 + t)e^{2t} + te^{2t} \\ &= \famone{c_1(1 + t)} + \famtwo{c_2 e^t} + \frac{1}{2}(t - 1)e^{2t} \end{aligned}