# Homework Help: First order differential equations

1. Jan 30, 2014

### DmytriE

1. The problem statement, all variables and given/known data
Consider the first order differential equation

$\frac{dx(t)}{dt} + ax(t) = f(t), x(0) = x_{0}, t\geq0$ ​

Suppose the "input signal" $f(t)=e^{-t}, t\geq0$. (a) Find the solution to the equation. Find a condition on the parameter a so that the solution of the (forced) system approaches zero as t→∞.

2. Relevant equations
$\frac{dy}{dt} + p(x)y = 0$

3. The attempt at a solution

Setup as a homogenous equation therefore f(t) = 0.
$\frac{dx(t)}{dt} + ax(t) = 0$

$\frac{dx(t)}{x(t)} = -a*dt$

$ln(x(t)) = -at$

$x(t) = e^{-at}$

I don't know how to proceed any further...

2. Jan 30, 2014

### BvU

What you found satisfies the homogeneous equation. You are still missing an integration constant.
Now you need one particular solution that satisfies the inhomeogeneous equation.
A times homogeneous solution + particular solution is ' the ' general solution

3. Jan 30, 2014

### DmytriE

Is the integration constant $e^{\int x(t) dt}$ or $e^{\int a dt}$?

I guess the only integration factor that makes sense is the later of the two.

Last edited: Jan 30, 2014
4. Jan 30, 2014

### BvU

No, I mean $x(t) = Ce^{-at}$ also satisfies the homogeneous equation.

5. Jan 30, 2014

### BvU

Next thing to try: $C = C(t)$. Put this in the inhomogeneous equation and see what equation you get for C.

6. Jan 30, 2014

### DmytriE

I'm sorry but you've now lost me. Why am I trying C=C(t)?

7. Jan 30, 2014

### BvU

Well, the $e^{-at}$ part of $x(t) = C(t)e^{-at}$ helps you get rid of the $+a x(t)$ term. In return, you are left with a differential equation for $C(t)$ that you may be able to solve.

8. Jan 30, 2014

### pasmith

Either use Method of undetermined coefficients or use the integrating factor $e^{at}$.

9. Jan 30, 2014

### Staff: Mentor

10. Jan 31, 2014

### DmytriE

How can you tell when a first differential needs to use an integrating factor?

11. Jan 31, 2014

### Saitama

The differential equation you have presented is a linear differential equation of first order and this immediately tells us to use the integrating factor.

12. Jan 31, 2014

### Dick

In this case, you don't need an integrating factor. Just put $x(t)=Ce^{-t}$ into the equation and solve for C. You can't always do that but it's a nice shortcut here. Can you see why you could guess it would work? In general, guessing a trial solution is often a good option. When you can.

13. Jan 31, 2014

### Staff: Mentor

Look at the left side of your equation. "a" is a constant, so it is certainly going to integrate nicely. If "a" can be integrated easily with respect to t, that's your first indicator. Now look at the right side of the equation. It's a function only of t. So, when you multiply both sides by the integrating factor, the right side will still only be a function only of t (that can be integrated). That's your second indicator.

Chet

14. Jan 31, 2014

### vanhees71

Perhaps it's good to give a general derivation of the integrating factor for 1st-order linear ODEs. The standard form of such an ODE is
$$y'(x)+p(x) y(x)=q(x),$$
where $p$ and $q$ are given functions and the equation is to besolved for $y(x)$. We look for the general solution.

The equation would be much easier, if we had a total derivative on the left-hand side, but that's not too difficult to achieve. You just substitute
$$z(x)=v(x) y(x).$$
From the product rule you get
$$z'(x)=v(x) y'(x)+v'(x) y(x).$$
Multiplying the ODE with $v(x)$ gives
$$v(x) y'(x)+p(x) v(x) y(x)=q(x) v(x).$$
To make the left-hand side equal to $z'(x)$ you obviously have to determine $v(x)$ so that
$$v'(x)=p(x) v(x)$$
This is very easily solved, because you can write
$$\frac{\mathrm{d}}{\mathrm{d} x} \ln \left (\frac{v(x)}{v_0} \right )=p(x).$$
This gives
$$v(x)=v_0 \exp \left (\int_{0}^{x} \mathrm{d} x' p(x') \right ).$$
Here $v_0 \neq 0$ is an arbitrary integration constant.

Thus, choosing $v(x)$ in this way we can write our ODE as
$$z'(x)=q(x) v(x)$$
with the general solution
$$z(x)=z_0 + \int_0^{x} \mathrm{d} x' q(x') v(x').$$
Finally we have
$$y(x)=\frac{z(x)}{v(x)}=\frac{z_0}{v(x)}+\frac{1}{v(x)} \int_0^{x} \mathrm{d} x' q(x') v(x').$$
As you see, the choice of $v_0$ doesn't affect your solution in any way, because it only appears as an overall factor in front of the integration constant $z_0$, and this can be lumped into the overall integration constant of the general solution of the homogeneous equation. Finally we have the general solution of the ODE
$$y(x)=\exp \left (-\int_0^{x} \mathrm{d} x' p(x') \right ) \left [y_0+ \int_0^x \mathrm{d} x' q(x') \exp \left ( \int_0^x \mathrm{d} x'' p(x'') \right ) \right].$$
Here $y_0$ is given by the initial-value condition $y(0)=y_0$.

15. Feb 1, 2014

### DmytriE

Thank you everyone! I finally figured it out using integrating factors. As for guessing, would you guess Ce^-t as a good solution because the function is forced by e^-t?

16. Feb 1, 2014

### Dick

It's a good guess because of the other side of the equation, if you differentiate $e^{-t}$ or multiply it by $a$, you just get back multiples of $e^{-t}$.