# Solve the differential equation

1. Aug 18, 2009

### Wardlaw

Having a slight problem with this question.

Solve the differential equation when di/dt+2i=sin3t, i=0 when t=0

For my answer i get i= 1/13(2sin3t-3cos3t+3e^2t).

However the answer at the back of the textbook has 3e^-2t.

Any ideas??

2. Aug 18, 2009

### HallsofIvy

Staff Emeritus
Looks a lot like homework to me!

Well, for one thing, if i(t)= (1/13)(2sin(3t)- 3cos(3t)+ 3e^(2t)) then i'= (1/13)(6 cos(3t)+ 9sin(3t)+ 6e^(2t)) which is not anything like "sin(3t)"!

3. Aug 18, 2009

### Wardlaw

Not homework. FUN!! Question taken from exercise XX from Calculus made easy ( Silvanus P Thomson)

4. Aug 18, 2009

### tiny-tim

Welcome to PF!

Hi Wardlaw! Welcome to PF!
Both your answer and the one in the book are obviously wrong (3e-2t ≠ 0 when t = 0).

Are you looking at the right answer?

5. Aug 18, 2009

### l'Hôpital

He's talking about how after you use integration factors, your c value has e^-2t as opposed to e^2t.

Remember that when you divide by e^2t, you get e^-2t.

6. Aug 19, 2009

### Wardlaw

This is not a homework question! This example was taken from Silvanus P Thomsons' Calculus made easy book.

Having a slight problem with this question.

Solve the differential equation when di/dt+2i=sin3t, i=0 when t=0

Any ideas?

7. Aug 19, 2009

### Feldoh

It's a first order linear ODE, do you know about the integrating factor method?

8. Aug 19, 2009

### Wardlaw

Re: Welcome to PF!

9. Aug 19, 2009

### Wardlaw

I already know that!! How do you do it?

10. Aug 19, 2009

### CFDFEAGURU

"I already know that!! How do you do it? "

Wardlaw calm down.

This ODE is of a type called seperable. These are the easiest ODE's to solve.

Simply rewrite the equation as

di + 2i = sin(3t) dt

Now integration both sides.

Thanks
Matt

11. Aug 19, 2009

### Mute

That is not correct. The way you have written it you should have written di + 2i dt = sin(3t) dt, which is not separated.

Anyways, OP, even if this isn't homework you must first show what you've tried. The integrating factor method is simple - you multiply the equation by some function f(t), and pick f(t) such that the left hand side becomes d(i f)/dt. If you expand d(i f)/dt using the product rule what do you get? If you compare this to your original ode multiplied by f(t), do you see what condition f(t) must satisfy to be able to write the left hand side in the desired form?

12. Aug 19, 2009

### CFDFEAGURU

Yes, you are correct. I apologize for this mistake.

Thanks
Matt

13. Aug 19, 2009

### Staff: Mentor

Two threads with same question merged. Thread moved to Homework Help. Even if the question is for self-study, it should be placed here.

14. Aug 19, 2009

### Wardlaw

Must multiply left and right hand sides by e^2t. After integration you get e^2t/13(2sin(3t)-3cos(3t))+c. Substitute i=0 when t=0 and c=3/13. Answer given by Silvanus P Thomson is i=1/13(2sin(3t)-3cos(3t)+3e^-2t. My question is where does the minus come from in the 2t?

No offence meant to anyone. Just getting a bit frustrated :rofl:

15. Aug 19, 2009

### tiny-tim

Hi Wardlaw!

(try using the X2 tag just above the Reply box )
hmm … if only you'd write it all out properly, you'd probably have spotted the mistake during your first post

"After integration", you got ie2t = ie2t(2sin(3t)-3cos(3t))/13 + C,

so i = … ?

16. Aug 19, 2009

### Дьявол

Just for solving the integral I got:

$$i=-2it - \frac{1}{3} cos(3t)$$

Regards.

17. Aug 19, 2009

### tiny-tim

Дьявол, you can't integrate 2i and get 2it … i is a variable.

18. Aug 19, 2009

### Дьявол

UUps... I missed that. I thought i=$\sqrt{-1}$.

Regards.

19. Aug 19, 2009

### HallsofIvy

Staff Emeritus
In addition to being a first order equation, this is a "linear equation with constant coefficients" and the standard method for such equations can be used.

First, separate out the "homogeneous part" which is di/dt+ 2i= 0. "Try" a solution of the form $i(t)= e^{kt}$. Since now $i'(t)= ke^{kt}$ the equation becomes $ke^{kt}+ 2e^{kt}= 0$. Since $e^{kt}$ is never 0, we can divide through by it and get the "characteristic equation" k+ 2= 0 which gives k= -2.

Now you can check that $i(t)= Ce^{-2t}$ satisfies di/dt+ 2i= 0.

It can be shown that any solution to the original equation is that general solution to di/dt+ 2i= 0 added to any single solution to entire equation. Try i(t)= Acos(3t)+ Bsin(3t) and determine A and B so that it satifies the original equation.

20. Aug 19, 2009

### n1person

Or you could be really fancy and use laplace transforms, which are frequently a little bit easier cause you include the initial conditions earlier and are less likely to have arithmetic mistakes.

sI(s)-i(0)+2I(s)= 3/(s^2+9)

sI(s)-0+2I(s)=3/(s^2+9)

(s+2)I(s)=3/(s^2+9)

I(s)=3/(s+2)(s^2+9)

from here all you have to do is decompose the partial fraction and do an inverse Laplace transform. If you never heard of these before, you'll learn about them later in your studies of differential equations (I like them a lot more than all other methods).