Solving IVPs with Laplace Transform

You've probably asked yourself why the Laplace transform is in the Differential Equations section. The answer is simple: because we can solve initial-value problems with the help of the Laplace transform.

Let's see how it is done.

Example 1. Solve y+4y=t{y}''+{4}{y}={t}, y(0)=0{y}{\left({0}\right)}={0}, y(0)=0{y}'{\left({0}\right)}={0}.

The first step is always to take the Laplace transform of both sides.

L(y+4y)=L(t){L}{\left({y}''+{4}{y}\right)}={L}{\left({t}\right)},

Or

L(y)+4L(y)=1s2{L}{\left({y}''\right)}+{4}{L}{\left({y}\right)}=\frac{{1}}{{{s}}^{{2}}}.

Now, since L(y)=s2Y(s)sy(0)y(0){L}{\left({y}''\right)}={{s}}^{{2}}{Y}{\left({s}\right)}-{s}{y}{\left({0}\right)}-{y}'{\left({0}\right)} (see the table of Laplace transforms), we obtain that

s2Y(s)sy(0)y(0)+4Y(s)=1s2{{s}}^{{2}}{Y}{\left({s}\right)}-{s}{y}{\left({0}\right)}-{y}'{\left({0}\right)}+{4}{Y}{\left({s}\right)}=\frac{{1}}{{{s}}^{{2}}}, or, using the initial conditions,

s2Y(s)s00+4Y(s)=1s2{{s}}^{{2}}{Y}{\left({s}\right)}-{s}\cdot{0}-{0}+{4}{Y}{\left({s}\right)}=\frac{{1}}{{{s}}^{{2}}}, which yields Y(s)=1s2(s2+4){Y}{\left({s}\right)}=\frac{{1}}{{{{s}}^{{2}}{\left({{s}}^{{2}}+{4}\right)}}}.

So, to find y(t){y}{\left({t}\right)}, we have to find the inverse Laplace transform.

The partial fraction decomposition is As+Bs2+Cs+Ds2+4=As(s2+4)+B(s2+4)+(Cs+D)s2s2(s2+4)=(A+C)s3+(B+D)s2+4As+4Bs2(s2+4)=1s2(s2+4)\frac{{A}}{{s}}+\frac{{B}}{{{s}}^{{2}}}+\frac{{{C}{s}+{D}}}{{{{s}}^{{2}}+{4}}}=\frac{{{A}{s}{\left({{s}}^{{2}}+{4}\right)}+{B}{\left({{s}}^{{2}}+{4}\right)}+{\left({C}{s}+{D}\right)}{{s}}^{{2}}}}{{{{s}}^{{2}}{\left({{s}}^{{2}}+{4}\right)}}}=\frac{{{\left({A}+{C}\right)}{{s}}^{{3}}+{\left({B}+{D}\right)}{{s}}^{{2}}+{4}{A}{s}+{4}{B}}}{{{{s}}^{{2}}{\left({{s}}^{{2}}+{4}\right)}}}=\frac{{1}}{{{{s}}^{{2}}{\left({{s}}^{{2}}+{4}\right)}}}

So, the following system is obtained:

{A+C=0B+D=04A=04B=1{\left\{\begin{array}{c}{A}+{C}={0}\\{B}+{D}={0}\\{4}{A}={0}\\{4}{B}={1}\\ \end{array}\right.}, which has the solution A=0,B=14,C=0,D=14{A}={0},{B}=\frac{{1}}{{4}},{C}={0},{D}=-\frac{{1}}{{4}}.

Thus,

y(t)=L1(Y(s))=L1(1s2(s2+4))=L1(141s2141s2+4)=14L1(1s2)14L1(1s2+4)=14t18L1(2s2+4)=14t18sin(2t){y}{\left({t}\right)}={{L}}^{{-{{1}}}}{\left({Y}{\left({s}\right)}\right)}={{L}}^{{-{1}}}{\left(\frac{{1}}{{{{s}}^{{2}}{\left({{s}}^{{2}}+{4}\right)}}}\right)}={{L}}^{{-{{1}}}}{\left(\frac{{1}}{{4}}\frac{{1}}{{{{s}}^{{2}}}}-\frac{{1}}{{4}}\frac{{1}}{{{{s}}^{{2}}+{4}}}\right)}=\frac{{1}}{{4}}{{L}}^{{-{{1}}}}{\left(\frac{{1}}{{{s}}^{{2}}}\right)}-\frac{{1}}{{4}}{{L}}^{{-{{1}}}}{\left(\frac{{1}}{{{{s}}^{{2}}+{4}}}\right)}=\frac{{1}}{{4}}{t}-\frac{{1}}{{8}}{{L}}^{{-{{1}}}}{\left(\frac{{2}}{{{{s}}^{{2}}+{4}}}\right)}=\frac{{1}}{{4}}{t}-\frac{{1}}{{8}}{\sin{{\left({2}{t}\right)}}}

That's all. For linear differential equations, it is always the case that we take the Laplace transform, algebraically find Y(s){Y}{\left({s}\right)}, and take the inverse transform to obtain the solution.

Also, it is easier to solve IVPs that involve a step function or a Dirac function with Laplace transforms.

Example 2. Solve y+y=u1(t){y}''+{y}'={u}_{{1}}{\left({t}\right)}, y(0)=0{y}{\left({0}\right)}={0}, y(0)=0{y}'{\left({0}\right)}={0}.

Take the Laplace transform

L(y)+L(y)=L(u1(t)){L}{\left({y}''\right)}+{L}{\left({y}'\right)}={L}{\left({u}_{{1}}{\left({t}\right)}\right)},

Or

(s2Y(s)sy(0)y(0))+(sY(s)y(0))=ess{\left({{s}}^{{2}}{Y}{\left({s}\right)}-{s}{y}{\left({0}\right)}-{y}'{\left({0}\right)}\right)}+{\left({s}{Y}{\left({s}\right)}-{y}{\left({0}\right)}\right)}=\frac{{{{e}}^{{-{{s}}}}}}{{s}}.

Applying the initial conditions gives:

s2Y(s)+sY(s)=ess{{s}}^{{2}}{Y}{\left({s}\right)}+{s}{Y}{\left({s}\right)}=\frac{{{e}}^{{-{s}}}}{{s}} or Y(s)=es1s2(s+1){Y}{\left({s}\right)}={{e}}^{{-{s}}}\frac{{1}}{{{{s}}^{{2}}{\left({s}+{1}\right)}}}.

The partical fraction decomposition for 1s2(s+1)\frac{{1}}{{{{s}}^{{2}}{\left({s}+{1}\right)}}} is 1s21s+1s+1\frac{{1}}{{{s}}^{{2}}}-\frac{{1}}{{s}}+\frac{{1}}{{{s}+{1}}}.

So,

y(t)=L1(es1s2)L1(es1s)+L1(es1s+1)=u1(t)(t1)u1(t)1+u1(t)e(t1)=u1(t)(t2+e1t){y}{\left({t}\right)}={{L}}^{{-{{1}}}}{\left({{e}}^{{-{s}}}\frac{{1}}{{{s}}^{{2}}}\right)}-{{L}}^{{-{{1}}}}{\left({{e}}^{{-{s}}}\frac{{1}}{{s}}\right)}+{{L}}^{{-{{1}}}}{\left({{e}}^{{-{s}}}\frac{{1}}{{{s}+{1}}}\right)}={u}_{{1}}{\left({t}\right)}{\left({t}-{1}\right)}-{u}_{{1}}{\left({t}\right)}{1}+{u}_{{1}}{\left({t}\right)}{{e}}^{{-{\left({t}-{1}\right)}}}={u}_{{1}}{\left({t}\right)}{\left({t}-{2}+{{e}}^{{{1}-{t}}}\right)}

Of course, we could rewrite the Heaviside function by definition and solve the differential equation on each interval separately, but this would require a greater amount of work.

Now, let's consider one more example.

Example 3. Calculate y+y=t{y}''+{y}'={t}, y(2)=0{y}{\left({2}\right)}={0}, y(2)=0{y}'{\left({2}\right)}={0}.

Notice that the initial conditions are not at 0{0}. In order to use the Laplace transform, we need the initial conditions to be at 0{0}. For this, use the change of variable: let a=t2{a}={t}-{2}; then:

y(a+2)+y(a+2)=a+2{y}''{\left({a}+{2}\right)}+{y}'{\left({a}+{2}\right)}={a}+{2}, y(0)=0{y}{\left({0}\right)}={0}, y(0)=0{y}'{\left({0}\right)}={0}.

To simplify the expression, let y(a+2)=u(a){y}{\left({a}+{2}\right)}={u}{\left({a}\right)}; then, y(a+2)=u(a){y}'{\left({a}+{2}\right)}={u}'{\left({a}\right)}, and y(a+2)=u(a){y}''{\left({a}+{2}\right)}={u}''{\left({a}\right)}; so, the equation can be rewritten as:

u+u=a+2{u}''+{u}'={a}+{2}, u(0)=0{u}{\left({0}\right)}={0}, u(0)=0{u}'{\left({0}\right)}={0}.

Now, we can use the Laplace transform:

L(u)+L(u)=L(a)+L(2){L}{\left({u}''\right)}+{L}{\left({u}'\right)}={L}{\left({a}\right)}+{L}{\left({2}\right)}

s2U(s)su(0)u(0)+sU(s)u(0)=1s2+2s{{s}}^{{2}}{U}{\left({s}\right)}-{s}{u}{\left({0}\right)}-{u}'{\left({0}\right)}+{s}{U}{\left({s}\right)}-{u}{\left({0}\right)}=\frac{{1}}{{{s}}^{{2}}}+\frac{{2}}{{s}}

Applying the initial conditions gives:

U(s)=1s2+2ss2+s=2s+1s3(s+1){U}{\left({s}\right)}=\frac{{\frac{{1}}{{{s}}^{{2}}}+\frac{{2}}{{s}}}}{{{{s}}^{{2}}+{s}}}=\frac{{{2}{s}+{1}}}{{{{s}}^{{3}}{\left({s}+{1}\right)}}}

The partial fraction decomposition is (verify!): 1s3+1s2+1s+11s\frac{{1}}{{{s}}^{{3}}}+\frac{{1}}{{{s}}^{{2}}}+\frac{{1}}{{{s}+{1}}}-\frac{{1}}{{s}}.

So, u(a)=L1(1s3+1s2+1s+11s)=L1(122s3+1s2+1s+11s)=12a2+a+ea1{u}{\left({a}\right)}={{L}}^{{-{{1}}}}{\left(\frac{{1}}{{{s}}^{{3}}}+\frac{{1}}{{{s}}^{{2}}}+\frac{{1}}{{{s}+{1}}}-\frac{{1}}{{s}}\right)}={{L}}^{{-{{1}}}}{\left(\frac{{1}}{{2}}\frac{{2}}{{{s}}^{{3}}}+\frac{{1}}{{{s}}^{{2}}}+\frac{{1}}{{{s}+{1}}}-\frac{{1}}{{s}}\right)}=\frac{{1}}{{2}}{{a}}^{{2}}+{a}+{{e}}^{{-{a}}}-{1}.

However, we need y(t){y}{\left({t}\right)}, not u(a){u}{\left({a}\right)}. Recall that y(t)=y(a+2)=u(a)=u(t2){y}{\left({t}\right)}={y}{\left({a}+{2}\right)}={u}{\left({a}\right)}={u}{\left({t}-{2}\right)}; so,

y(t)=12(t2)2+t2+e(t2)1=12t2t1+e2t{y}{\left({t}\right)}=\frac{{1}}{{2}}{{\left({t}-{2}\right)}}^{{2}}+{t}-{2}+{{e}}^{{-{\left({t}-{2}\right)}}}-{1}=\frac{{1}}{{2}}{{t}}^{{2}}-{t}-{1}+{{e}}^{{{2}-{t}}}.

The Laplace transform can be used to solve linear equations with non-constant coefficients. In general, it is very hard to solve them, and the Laplace transform can rarely help, however such cases do exist.