Example

Let's solve the initial value problem y''+2ty-4y=1, y(0)=y'(0)=0.

In[90]:=

  Clear[de,tde,newtde,Y,y]

Here's the differential equation:

In[91]:=

  de=y''[t]+2 t y'[t]-4 y[t]==1

Out[91]=

  -4 y[t] + 2 t y'[t] + y''[t] == 1

Here is the transformed differential equation:

In[92]:=

  tde=LaplaceTransform[de,t,s]

Out[92]=

                                     2
  -4 LaplaceTransform[y[t], t, s] + s  LaplaceTransform[y[t], t, s] - 
   
     s y[0] - y'[0] + 2 (-LaplaceTransform[y[t], t, s] - 
   
                          (0,0,1)                 1
        s LaplaceTransform       [y[t], t, s]) == -
                                                  s

Let's make use of the initial values:

In[93]:=

  newtde=tde/.{y[0]->0,y'[0]->0}

Out[93]=

                                     2
  -4 LaplaceTransform[y[t], t, s] + s  LaplaceTransform[y[t], t, s] + 
   
     2 (-LaplaceTransform[y[t], t, s] - 
   
                          (0,0,1)                 1
        s LaplaceTransform       [y[t], t, s]) == -
                                                  s

This is a differential equation in Y[s]. To save you (and Mathematica) some grief, retype the DE interms of the Laplace transform Y[s].

In[94]:=

  deinY=-4 Y[s]+s^2 Y[s]-2 Y[s]-2 s Y'[s]==1/s

Out[94]=

             2                     1
  -6 Y[s] + s  Y[s] - 2 s Y'[s] == -
                                   s

Now solve the differential equation in Y[s].

In[95]:=

  DSolve[deinY,Y[s],s];
  Y[s]:=Evaluate[Y[s]/.Flatten[%]]
  Y[s]

Out[95]=

          2
   -3    s /4 - 3 Log[s]
  s   + E                C[1]

Before transforming back to get y(t), we must realize that the limit as s->Infinity of Y[s] is 0 if Y is the Laplace transform of an appropriate function. Check your text for such a theorem. In order for Lim{s->Infinity} Y[s] to be 0 we need C[1] to be 0 (do you see why?).

Now transform back to find y(t).

In[96]:=

  y[t_]:=InverseLaplaceTransform[Y[s]/.C[1]->0,s,t]
  y[t]
  

Out[96]=

   2
  t
  --
  2

Up to Solving Initial Value Problems with Polynomial Coefficients