# Differential Equations question

This is a discussion on Differential Equations question within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I just started a new class that has Differential Equations as a prerequisite, so as a refresher our teacher gave ...

1. ## Differential Equations question

I just started a new class that has Differential Equations as a prerequisite, so as a refresher our teacher gave us a little assignment (not for credit so asking this wouldn't be cheating)that had many calc and DE's refresher questions. But its been a few years since I took the DE's class and one of the questions is screwing me up... anyone know if I am doing this right?

The question: dx/dt + 3x = 0, x(0)=2, x(t)=?

Okay, if memory serves, the first thing to do is get the dx and dt on separate sides and then integrate.

dx/dt=-3x

dt=(-1/3)dx

Integrating... t=(-1/3) ln(x) + C

Plugging in the values above to solve for C... 2=(-1/3) ln (0) + C

But the natural log of zero is undefined, so I know that I am doing something wrong... any help?

2. x(0)=2 -> x=2 when t=0

3. Ahhh... so then

-3t + C = ln(x)

e^(-3t) + C = x

e^(0) + C = 2

C=1

x(t) = e^(-3t) + 1

Thanks!

4. >dt=(-1/3)dx
>Integrating... t=(-1/3) ln(x) + C
Wouldn't it become:
t=(-1/3)x + C
-> X=-3t + C

<edit>
I see now. That first line I quoted should have an X with 3.

- Sean

5. Oops, you're right, tis a typo.

Change

dt=(-1/3)dx

to

dt=(-1/3x)dx

6. Originally posted by PJYelton
Ahhh... so then

-3t + C = ln(x)

e^(-3t) + C = x

e^(0) + C = 2

C=1

x(t) = e^(-3t) + 1

Thanks!
Err... not quite. Its not a solution to dx/dt=-3x. Here (note, I'm sloppy with the 'C' because I'm not looking for a particular form of it).

dx/dt = -3x

(-1/3)(dx/x) = dt

dx/x = -3dt

ln x = -3t + C

x = e^(-3t+C)

x = Ce^(-3t) [The sloppiness I mentioned]

2 = Ce^0

C = 2

x(t) = 2e^(-3t)

7. Jeez I feel like an idiot For some reason I thought: