# Thread: How to solve this linear homogeneous ODE?

1. ## How to solve this linear homogeneous ODE?

I want to find solution to following ODE
$\frac{d \bar h}{dt} + \frac{K}{S_s} \alpha^2 \bar h = -\frac{K}{S_s} \alpha H h_b(t)$

I have tried to solve it with integration method with following steps

taking itegrating factor as $I=\exp^{\int \frac{1}{D} \alpha^2 dt}$ and ~ $\frac{K}{S_s} = \frac{1}{D}$

$I \frac{d \bar h}{dt} + I \frac{1}{D} \alpha^2 \bar h = -I \frac{1}{D} \alpha H h_b(t)$

$I \frac{d \bar h}{dt} + I \frac{1}{D} \alpha^2 \bar h= -I \frac{1}{D} \alpha H h_b(t)$

$\frac{d \bar h}{dt} \exp^{\frac{1}{D} \alpha^2 dt} + \frac{1}{D} \alpha^2 \bar h \exp^{\int \frac{1}{D} \alpha^2 dt} = - \frac{1}{D} \alpha H h_b(t) \exp^{\int \frac{1}{D} \alpha^2 dt}$

$\frac{d \bar h}{dt} \exp^{\int \frac{1}{D} \alpha^2 dt} = - \frac{1}{D} \alpha H h_b(t) \exp^{\int \frac{1}{D} \alpha^2 dt}$

$\int_0^t \frac{d \bar h}{dt} \exp^{\int \frac{1}{D} \alpha^2 dt} = \int_0^t - \frac{1}{D} \alpha H h_b(t) \exp^{\int \frac{1}{D} \alpha^2 dt} dt$

$\bar h I = - \frac{1}{D} \alpha H \int_0^t h_b(t) \exp^{\int \frac{1}{D} \alpha^2 dt} dt$

$\bar h = - \frac{1}{D} \alpha H \int_0^t h_b(t) \exp^{\int \frac{1}{D} \alpha^2 d \tau} \exp^{- \int \frac{1}{D} \alpha^2 dt} dt$

$\bar h = - \frac{1}{D} \alpha H \int_0^t h_b(t) \exp^{\int \frac{1}{D} \alpha^2 d \tau - \int \frac{1}{D} \alpha^2 dt} dt$

$\bar h = - \frac{1}{D} \alpha H \int_0^t h_b(t) \exp^{\frac{1}{D} \alpha^2 \int d \tau - \int dt} dt$

$\bar h = - \frac{1}{D} \alpha H \int_0^t h_b(t) \exp^{\frac{1}{D} \alpha^2 ( \tau - t)} dt$

2. ## Re: How to solve this linear homogeneous ODE?

That's a linear equation so another way to solve such an equation, that I prefer, is to solve $\frac{d\overline{h}}{dt}+ \frac{K\alpha^2}{S_S}\overline{h}= 0$. That's easy: $\int \frac{d\overline{h}}{\overline{h}}= -\int\frac{K\alpha^2}{S_S}dt$, $ln(\overline{h})= -\frac{K\alpha^2}{S_S}t+ C_1$ where $C_1$ is an arbitrary constant. Taking the exponential of both sides, we can write the solution to this equation as $\overline{h}(t)= C_2e^{-\frac{K\alpha^2}{S_S}t}$ where $C_2= e^{C_1}$.

Now, look for a solution to the entire equation of the form $\overline{h}= f(t)e^{-\frac{K\alpha^2}{S_S}t}$ (we are allowing the constant in the previous solution to be a function- this is 'variation of parameters').

Then $\frac{d\overline{h}}{dt}= f'(t)e^{-\frac{K\alpha^2}{S_S}t}- \frac{K\alpha^2}{S_S}f(t)e^{-\frac{K}{S_S}t}$ so that the equation becomes $f'(t)e^{-\frac{K\alpha^2}{S_S}t}- \frac{K\alpha^2}{S_S}f(t)e^{-\frac{K\alpha^2}{S_S}t}+ \frac{K\alpha^2}{S_S}e^{-\frac{K\alpha^2}{S_S}t}= f'(t)e^{-\frac{K\alpha^2}{S_S}t}= -\frac{K}{S_S}\alpha Hh_b(t)$

$f'(t)= -\frac{K}{S_S}\alpha H h_b(t)e^{\frac{K\alpha^2}{S_S}t}$
$f(t)= -\frac{\alpha KH}{S_S}\int h_b(t)e^{\frac{k\alpha^2}{S_S}t}$

One solution to the entire equation is
$\overline{h}= -\frac{\alpha KH}{S_S}e^{-\frac{K\alpha^2}{S_S}t}\int h_b(t)e^{\frac{k\alpha^2}{S_S}t}$

Since this equation is linear, the general solution to the equation is the general solution to the previous equation plus this solution to the entire equation:
$\overline{h}(t)= C_2e^{-\frac{K\alpha^2}{S_S}t}-\frac{\alpha KH}{S_S}e^{-\frac{K\alpha^2}{S_S}t}\int h_b(t)e^{\frac{k\alpha^2}{S_S}t}$