# Thread: General Solution of inhomogenous ODE

1. ## General Solution of inhomogenous ODE

ok,so again, reading my lecture notes,i bumped into this problem..

consider
A = (1 2,
0 -1)
find the general solution of
x' = Ax + ( 0,1 )

write x = (x, y) then the ODE is :
x' = x+2y
y' = -y + 1

y' = -y+1 implies y(t) = Ce^-t + 1 (how did one obtain this?? )

The ODE for x(t) is x' = x + 2(C(e^-t) + 1)
This linear inhomogeneous ODE gives x(t) = -2 - c(e^-t) + d(e^t) again how does one get this? i integrated but i cant get this. after trying for hours..i simply gave up ='(

thank you !

2. While the technique described in this post works, there is a big-time shortcut to this problem that I initially oversaw. The shortcut works when A is a constant matrix. Check the posts after this one for an explanation of this shortcut method.

The idea of variation of parameters is to seek the solution to
$\displaystyle \bf{x}' = A\bf{x} + \bf{b}$
in the form
$\displaystyle \bf{v}_1(t)\bf{x}_1(t) + \bf{v}_2 (t)\bf{x}_2 (t) = F(t)\bf{v}(t)$

whereby $\displaystyle F(t) = \begin{bmatrix} x_1 & x_2 \end{bmatrix}$ is a fundamental matrix.

Note that the constant vector c of coefficients is replaced by an unknown function v(t).

What is the equation for our unknown function v(t) you ask?
It is fairly straight forward to derive:

$\displaystyle (F\bf{v})' = F'\bf{v} + F\bf{v'} = A(F\bf{v}) + \bf{b} \implies F\bf{v'} = \bf{b} \implies \bf{v'} = F^{-1}\bf{b}$ .

IMPORTANT: You must make sure that $\displaystyle F^{-1}$ exists in order to solve for v !!!! (not factorial)

Finally, using integration, we have:

$\displaystyle \bf{x}(t) = F(t) \int F(t)^{-1} \bf{b}(t)dt$

I'll now rewrite the original problem in latex so it is more palatable to the eye:

Find the general solution of
$\displaystyle \bf{x}' = A\bf{x} + \begin{bmatrix} 0 \\ 1 \end{bmatrix}$ , whereby $\displaystyle A = \begin{bmatrix} 1 & 2 \\ 0 & -1 \end{bmatrix}$.

Does this help?

3. Originally Posted by abender
The idea of variation of parameters is to seek the solution to
$\displaystyle \bf{x}' = A\bf{x} + \bf{b}$
in the form
$\displaystyle \bf{v}_1(t)\bf{x}_1(t) + \bf{v}_2 (t)\bf{x}_2 (t) = F(t)\bf{v}(t)$
whereby $\displaystyle F(t) = \begin{bmatrix} x_1 & x_2 \end{bmatrix}$ is a fundamental matrix.

Note that the constant vector c of coefficients is replaced by an unknown function v(t).

What is the equation for our unknown function v(t) you ask?
It is fairly straight forward to derive:
$\displaystyle (F\bf{v})' = F'\bf{v} + F\bf{v'} = A(F\bf{v}) + \bf{b} \implies F\bf{v'} = \bf{b} \implies \bf{v'} = F^{-1}\bf{b}$ .
IMPORTANT: You must make sure that $\displaystyle F^{-1}$ exists in order to solve for v !!!! (not factorial)

Finally, using integration, we have:
$\displaystyle \bf{x}(t) = F(t) \int F(t)^{-1} \bf{b}(t)dt$
I'll now rewrite the original problem in latex so it is more palatable to the eye:

Find the general solution of
$\displaystyle \bf{x}' = A\bf{x} + \begin{bmatrix} 0 \\ 1 \end{bmatrix}$ , whereby $\displaystyle A = \begin{bmatrix} 1 & 2 \\ 0 & -1 \end{bmatrix}$.
Does this help?
I believe this is an overkill for this particular system.

Originally Posted by matlabnoob
ok,so again, reading my lecture notes,i bumped into this problem..

consider
A = (1 2,
0 -1)

find the general solution of
x' = Ax + ( 0,1 )

write x = (x, y) then the ODE is :
x' = x+2y
y' = -y + 1

y' = -y+1 implies y(t) = Ce^-t + 1 (how did one obtain this?? ) (*)

The ODE for x(t) is x' = x + 2(C(e^-t) + 1) (**)
This linear inhomogeneous ODE gives x(t) = -2 - c(e^-t) + d(e^t) again how does one get this? i integrated but i cant get this. after trying for hours..i simply gave up ='(

thank you !
First question (*) above. It is a separable ODE - separate and integrate.
Second question (**) is linear with the integrating factor $\displaystyle \mu = e^{-t}$.

4. Or perhaps I have an easier way of doing this.

We have a matrix differential equation of the form

$\displaystyle \bf{x}'(t) = A\bf{x}(t) + \bf{b}(t)$

whereby $\displaystyle A$ is a constant matrix.

Since $\displaystyle A$ is a constant matrix, if we can calculate $\displaystyle e^{tA}$ , then we can find the solution to the system. So, we make $\displaystyle e^{tA}$ an integrating factor and multiply throughout:

$\displaystyle e^{-tA} \bf{x}'(t) = e^{-tA} A\bf{x}(t) + e^{-tA} \bf{b}(t)$

$\displaystyle \implies e^{-tA} \bf{x}'(t) - e^{-tA} A\bf{x}(t) = e^{-tA} \bf{b}(t)$

$\displaystyle \implies \frac{d}{dt} \big{[} e^{-tA} \bf{x}(t) \big{]} = e^{-tA} \bf{b}(t)$

$\displaystyle \implies \bf{x}(t) = e^{tA} \big{[} \int^t_0 e^{-\mu A} \bf{b}(\mu) d\mu \big{]}$

5. thanks!!im still trying to follow through

im not v.good with things unless they're worked out directly from how they originally are.but i have to know the method anyway

6. You're welcome and I appreciate your appreciation.

Which part of the problem are having the most difficulty with? Is it the "setting things up" part? Crunching the integral? Just getting started??

-Andy

7. Originally Posted by abender
You're welcome and I appreciate your appreciation.

Which part of the problem are having the most difficulty with? Is it the "setting things up" part? Crunching the integral? Just getting started??

-Andy
the main things im having difficult with (i still dont know! spend the night trying to figure out. aah.. maths takes me forever to solve)
.. they are :

y' = -y+1 implies y(t) = Ce^-t + 1

ok so for this i integrated just the homogeneous equation first, which i took as dy/dt + y = 0 and i got Ce^-t from that! but how did the +1 get there too? =S.... im not sure how to solve this without making errors or forgetting the +1 ..

and.. when i tried to integrate..
x(t) is x' = x + 2(C(e^-t) + 1)

i couldnt get..
x(t) = -2 - c(e^-t) + d(e^t)

i tried integrating by parts... substitution... it wont work

8. Originally Posted by matlabnoob
the main things im having difficult with (i still dont know! spend the night trying to figure out. aah.. maths takes me forever to solve)
.. they are :

y' = -y+1 implies y(t) = Ce^-t + 1

ok so for this i integrated just the homogeneous equation first, which i took as dy/dt + y = 0 and i got Ce^-t from that! but how did the +1 get there too? =S.... im not sure how to solve this without making errors or forgetting the +1 ..

and.. when i tried to integrate..
x(t) is x' = x + 2(C(e^-t) + 1)

i couldnt get..
x(t) = -2 - c(e^-t) + d(e^t)

i tried integrating by parts... substitution... it wont work

First ODE $\displaystyle \frac{dy}{dt} = - (y-1)$ so $\displaystyle \frac{dy}{y-1} = - dt$ so $\displaystyle \ln | y-1 | = - t + \ln c$. Exponentiating gives $\displaystyle y = ce^{-t} + 1$.

Second ODE $\displaystyle \frac{dx}{dt} - x = 2\left(c e^{-t} + 1 \right)$. The integrating factor is

$\displaystyle \mu = e^{-t}$ so $\displaystyle e^{-t} \left( \frac{dx}{dt} - x\right) = e^{-t} 2\left(c e^{-t} + 1 \right)$.

Thus, $\displaystyle \frac{d}{dt} \left( x e^{-t} \right) = 2c e^{-2t} + 2 e^{-t}$ and integrating gives $\displaystyle x e^{-t} = -c e^{-2t} - 2 e^{-t} + d$. Isolating x gives $\displaystyle x = -c e^{-t} - 2 + de^{t}$

9. Good morning.

The question asks us to find the general solution to

$\displaystyle \boldsymbol{x}'(t) = A\boldsymbol{x}(t) + \boldsymbol{b}(t)$

whereby

$\displaystyle A = \begin{bmatrix} 1 & 2 \\ 0 & -1 \end{bmatrix}$ , $\displaystyle \boldsymbol{b}(t) = \begin{bmatrix} 0 \\ 1 \end{bmatrix}$ .

Just in case this it is a source of confusion for you, I'll clarify that \boldsymbol{x} can be (and in this post, is) expressed as follows:

$\displaystyle \boldsymbol{x}(t) = \begin{bmatrix} x \\ y \end{bmatrix}$ .

Now I will generalize much less and try to spell out each step and computation for you. It will take a bit longer, but perhaps you need to see things this way.

We begin by plugging in what we know into
$\displaystyle \boldsymbol{x}'(t) = A\boldsymbol{x}(t) + \boldsymbol{b}(t)$ .

We get

$\displaystyle \begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} 1 & 2 \\ 0 & -1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} + \begin{bmatrix} 0 \\ 1 \end{bmatrix} =$ $\displaystyle \begin{bmatrix} x + 2y \\ -y \end{bmatrix} + \begin{bmatrix} 0 \\ 1 \end{bmatrix} =$ $\displaystyle \begin{bmatrix} x+2y \\ -y +1 \end{bmatrix}$ .

So we have

$\displaystyle \begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} x+2y \\ -y +1 \end{bmatrix}$ .

Now we multiply both sides by the integrating factor $\displaystyle e^{-tA}$ .

$\displaystyle e^{-tA} \begin{bmatrix} x' \\ y' \end{bmatrix} = e^{-tA} \begin{bmatrix} x+2y \\ -y +1 \end{bmatrix}$

Now, let's explain $\displaystyle e^{-tA}$ , which is called a matrix exponential. I'll give a general definition:

Let M be a an n x n matrix. $\displaystyle e^M$ is the matrix exponential of M , which is expressed by the power series

$\displaystyle e^{M} = \sum_{k=0}^\infty \frac{1}{k!} M^k$ .

Note that the exponential of M is well-defined, as the series always converges.

Are you following so far?