The method of variation of parameters can be used to solve non-homogenous differential equations, it works on a wider variety of differential equations than the method of undetermined coefficents.
We have a second order differential equation of the following form:
d 2 y d x 2 + p d x d y + q y = f ( x ) \frac{d^2y}{dx^2}+p\frac{dx}{dy}+qy=f(x) d x 2 d 2 y + p d y d x + q y = f ( x )
The solution to the homogenous DE y ′ ′ + p y ′ + q y = 0 y'' + py'+qy=0 y ′′ + p y ′ + q y = 0 :
y h = y 1 + y 2 y_h=y_1+y_2 y h = y 1 + y 2
The formula for the particular solution y p y_p y p
y p = − y 1 ( x ) ∫ y 2 ( x ) f ( x ) W ( y 1 , y 2 ) d x + y 2 ( x ) ∫ y 1 ( x ) f ( x ) W ( y 1 , y 2 ) d x y_p= -y_1(x)\int \frac{y_2(x)f(x)}{W(y_1, y_2)}dx + y_2(x)\int\frac{y_1(x)f(x)}{W(y_1, y_2)}dx y p = − y 1 ( x ) ∫ W ( y 1 , y 2 ) y 2 ( x ) f ( x ) d x + y 2 ( x ) ∫ W ( y 1 , y 2 ) y 1 ( x ) f ( x ) d x
Steps
There is a kind of general formula to follow.
Solve the homogenous equation d 2 y d x 2 + p d x d y + q y = 0 \frac{d^2y}{dx^2}+p\frac{dx}{dy}+qy=0 d x 2 d 2 y + p d y d x + q y = 0 to get y h y_h y h
Calculate the wronskian W ( y 1 , y 2 ) W(y_1, y_2) W ( y 1 , y 2 ) where y p = y 1 + y 2 y_p=y_1 + y_2 y p = y 1 + y 2 .
Plug the functions into the integral, y 1 y_1 y 1 , y 2 y_2 y 2 , f ( x ) f(x) f ( x ) , W ( y 1 , y 2 ) W(y_1, y_2) W ( y 1 , y 2 )
Solve and simplify the integral to get y p y_p y p
The general solution is y = y h + y p y = y_h + y_p y = y h + y p
Problem 1: Solve the following differential equation: y ′ ′ + 8 y ′ + 16 y = 4 x y''+8y'+16y=4x y ′′ + 8 y ′ + 16 y = 4 x
Solution 2 : General solution is y = y h + y p y = y_h + y_p y = y h + y p .
We find y h y_h y h first by solving the homogenous DE y ′ ′ + 8 y ′ + 16 y = 0 y'' + 8y' + 16y=0 y ′′ + 8 y ′ + 16 y = 0 . Characteristic polynomial is m 2 + 8 m + 16 y = 0 → ( m + 4 ) ( m + 4 ) → m = − 4 m^2 + 8m + 16y=0 \rightarrow (m+4)(m+4) \rightarrow m=-4 m 2 + 8 m + 16 y = 0 → ( m + 4 ) ( m + 4 ) → m = − 4
Since there is one solution for m m m , y h = c 1 e − 4 x + c 2 x e − 4 x y_h=c_1e^{-4x} + c_2xe^{-4x} y h = c 1 e − 4 x + c 2 x e − 4 x .
Now we find the Wronskian where y 1 ( x ) = e − 4 x y_1(x)=e^{-4x} y 1 ( x ) = e − 4 x and y 2 ( x ) = x e − 4 x y_2(x)=xe^{-4x} y 2 ( x ) = x e − 4 x .
∣ y 1 ( x ) y 2 ( x ) y 1 ′ ( x ) y 2 ′ ( x ) ∣ = e − 8 x \begin{vmatrix} y_1(x) &y_2(x) \\y_1'(x) & y_2'(x) \end{vmatrix}=e^{-8x} ∣ ∣ y 1 ( x ) y 1 ′ ( x ) y 2 ( x ) y 2 ′ ( x ) ∣ ∣ = e − 8 x
Now, we plug into the integral, note that f ( x ) = 4 x f(x)=4x f ( x ) = 4 x
y p = − e − 4 x ∫ x e − 4 x 4 x e − 8 x d x + x e − 4 x ∫ e − 4 x 4 x e − 8 x d x y_p= -e^{-4x}\int \frac{xe^{-4x}4x}{e^{-8x}}dx + xe^{-4x}\int\frac{e^{-4x}4x}{e^{-8x}}dx y p = − e − 4 x ∫ e − 8 x x e − 4 x 4 x d x + x e − 4 x ∫ e − 8 x e − 4 x 4 x d x
Simplify
y p = − 4 e − 4 x ∫ x 2 e 4 x d x + 4 x e − 4 x ∫ e 4 x x d x y_p= -4e^{-4x}\int x^2e^{4x}dx + 4xe^{-4x}\int e^{4x}xdx y p = − 4 e − 4 x ∫ x 2 e 4 x d x + 4 x e − 4 x ∫ e 4 x x d x
y p = 4 e − 4 x ( − 1 ∫ x 2 e 4 x d x + x ∫ e 4 x x d x ) y_p= 4e^{-4x}(-1\int x^2e^{4x}dx + x\int e^{4x}xdx) y p = 4 e − 4 x ( − 1 ∫ x 2 e 4 x d x + x ∫ e 4 x x d x )
When we solve the integral and get the constants, just set the C = 0 C=0 C = 0 to remove it (and make sure to remove anything attached to the C C C ).
Solving the integral we get:
Steps for Integration . Click the link to see how this was integrated.
y p = x 4 − 1 8 y_p=\frac{x}{4}-\frac{1}{8} y p = 4 x − 8 1
Therefore, the general solution is
y = c 1 e − 4 x + c 2 x e − 4 x + x 4 − 1 8 y=c_1e^{-4x} + c_2xe^{-4x} + \frac{x}{4}-\frac{1}{8} y = c 1 e − 4 x + c 2 x e − 4 x + 4 x − 8 1
Problem 2: Solve the differential equation y ′ ′ − 3 y ′ = − 9 e 3 t y''-3y'=-9e^{3t} y ′′ − 3 y ′ = − 9 e 3 t
Solution 2:
Find y h y_h y h : m 2 − 3 m = 0 → m ( m − 3 ) → m = 0 , 3 m^2-3m=0\rightarrow m(m-3) \rightarrow m=0,3 m 2 − 3 m = 0 → m ( m − 3 ) → m = 0 , 3 . Therefore, y h = c 1 + c 2 e 3 t y_h=c_1+c_2e^{3t} y h = c 1 + c 2 e 3 t
Get the Wronskian W ( y 1 , y 2 ) = 3 e 3 t W(y_1, y_2) = 3e^{3t} W ( y 1 , y 2 ) = 3 e 3 t . Remember f ( x ) = − 9 e 3 t f(x)=-9e^{3t} f ( x ) = − 9 e 3 t
Plug into the equation for y p y_p y p
y p = − ∫ − 9 e 3 t e 3 t 3 e 3 t d t + e 3 t ∫ − 9 e 3 t 3 e 3 t d t y_p= -\int \frac{-9e^{3t}e^{3t}}{3e^{3t}}dt + e^{3t}\int\frac{-9e^{3t}}{3e^{3t}}dt y p = − ∫ 3 e 3 t − 9 e 3 t e 3 t d t + e 3 t ∫ 3 e 3 t − 9 e 3 t d t
This integral simplifies into the following.
y p = 3 ∫ e 3 t d t + e 3 t ∫ − 3 d t y_p= 3\int e^{3t}dt + e^{3t}\int -3dt y p = 3 ∫ e 3 t d t + e 3 t ∫ − 3 d t
This is a simple integral, solve and simplify to get the following answer for y p y_p y p .
y p = e 3 t − 3 t e 3 t = e 3 t ( 1 − 3 t ) y_p = e^{3t}-3te^{3t} = e^{3t}(1-3t) y p = e 3 t − 3 t e 3 t = e 3 t ( 1 − 3 t )
The general solution y = y h + y p y = y_h + y_p y = y h + y p is
y = c 1 + c 2 e 3 x + e 3 t ( 1 − 3 t ) y=c_1+c_2e^{3x} + e^{3t}(1-3t) y = c 1 + c 2 e 3 x + e 3 t ( 1 − 3 t )