# ODE Method of variation of parameters problem

Assignment Statement

given $$y^{\prime} + p(t)y = q(t)$$ a general linear equation where $$q(t)$$ is not zero everywhere,

I'm asked to find $$C(t)$$ form $$C^{\prime}(t)= q(t)e^{\int p(t) \ dt}$$ then substitute in $$y(t) = C(t)e^{-\int p(t) \ dt}$$ to extract the y(t) solution.

Attempt at solution

I'm having trouble at the first step if I integrate both sides I get $$C(t) = \int\left( q(t) e^{\int p(t) \ dt}\right) \ dt$$

I feel like I have to do integration by parts on the right-hand side but both substitutions give me very odd expressions involving integrals of integrals and I'm genuinely confused how to start.

I also tough that maybe I just substitute everything and do something on the final expression which is: $$y(t) = \frac{\int\left( q(t) e^{\int p(t) \ dt}\right) \ dt}{e^{\int p(t) \ dt}}$$ I notice there's a common factor $$e^{\int p(t) \ dt}$$ maybe I have to do something with that ?

When you apply the method of $$\textrm{variation of parameters}$$ you firstly have to solve the homogeneous equation $$y^{\prime} + p(t)\cdot y =0$$

$$y^{\prime} =- p(t)\cdot y$$

$$\frac{dt}{y}=-p(t) \, dt$$

$$\ln(y)=-\int p(t) \, dt$$

$$y_h=C\cdot e^{-\int p(t) \, dt}$$

Then the non-homogeneous solution is $$y_p=C(t)\cdot e^{-\int p(t) \, dt}$$. Differentiating the function gives

$$y'_p=C'(t)\cdot e^{-\int p(t) \, dt}-C(t)\cdot p(t) \cdot e^{-\int p(t) \, dt}$$.

Plugging into the non-homogeneous equation.

$$C'(t)\cdot e^{-\int p(t) \, dt}\underbrace{-C(t)\cdot p(t) \cdot e^{-\int p(t) \, dt}+p(t)\cdot C(t)\cdot e^{-\int p(t) \, dt}}_{=0}=q(t)$$

$$C'(t)\cdot e^{-\int p(t) \, dt}=q(t)$$

$$C'(t)=q(t)\cdot e^{\int p(t) \, dt}\Rightarrow C(t)=\int q(t)\cdot e^{\int p(t) \, dt} \, dt$$. Using this result to obtain $$y_p$$.

$$y_p=e^{-\int p(t) \, dt} \cdot \int q(t)\cdot e^{\int p(t) \, dt} \, dt$$. It total we get

$$y=y_h+y_p=C\cdot e^{-\int p(t) \, dt}+e^{-\int p(t) \, dt} \cdot \int q(t)\cdot e^{\int p(t) \, dt} \, dt$$

$$=\left(C+\int q(t)\cdot e^{\int p(t) \, dt} \, dt\right)\cdot e^{-\int p(t) \, dt}$$

• Thank you for your reply this seems right, I just don't quite understand the step : $$y = y_{h} + y_{p}$$ Does it say that the solution to $y$ is the sum of the homogeneous with the non-homogeneous solution ? Is that like a theorem or something , because I don't remember seen this in class. Jan 24 '20 at 13:30
• @hitechphysics Yes, it is the sum. It is hard to explain in short. Maybe the first pages of this document make it clearer. Jan 24 '20 at 14:41

Multiply both sides of $$y^{\prime} + p(t)y = q(t)$$ by $$e^{\int p(t)dt}$$ to get $$y^{\prime}e^{\int p(t)dt} + p(t)e^{\int p(t)dt}y = e^{\int p(t) dt}q(t)$$

The LHS is the derivative of $$ye^{\int p(t)dt}$$ Thus upon integration of both sides you get $$ye^{\int p(t)dt} = \int e^{\int p(t) dt}q(t) +C$$

Solve for $$y$$ and you get $$y =e^{-\int p(t)dt} \int e^{\int p(t) dt}q(t) \ dt+Ce^{-\int p(t)dt}$$

• Thank you for your reply, but does this solving method actually use the method of variation of parameters ? Jan 23 '20 at 17:45
• This method is called the integrating factor method but as you mentioned it is a variation of parameters method. Jan 23 '20 at 19:47