# Homework Help: Linear 1st order differential equations

1. Oct 16, 2009

### ch2kb0x

1. The problem statement, all variables and given/known data
dy/dx + ytanx = secx, y(pi) = 1

2. Relevant equations

I(x) = e^integral P(x)dx
Integral Q(x)e^integral P(x)dx
y=e^-integral P(x)dx (integral Q(x)e^integral P(x)dx + C)

(sorry, it is a bit messy, I don tknow how to use the math symbols yet)
3. The attempt at a solution
dy/dx + ytanx = secx, where P(x) = tanx, Q(x) = secx

ytanx - secx + dy/dx = 0

I(x) = e^Integral tanx = e^-ln(cosx)

Integral Q(x)e^integral P(x)dx = Integral (1/cosx) e^-ln(cosx) dx.

^^this is where I am stuck, either I did something wrong in the beginning, and/or it has to be integrated by parts. I only know how to do the "tabular table" method for parts, so if my calculations were right to that point, could somebody help me through the rest of the problem. thanks :(

2. Oct 16, 2009

### Dick

It looks confusing because you aren't simplifying the integrating factor. exp(-ln(cos(x))) can be written in a much simpler form using rules of exponents and logs. What is it?

3. Oct 16, 2009

### ch2kb0x

Nm, i know how to solve it now, thanks.

Although, I am stuck on this problem now:

dy/dx - y = 4e^x, with y(0) = 4.

How do I solve this when there isn't a P(x) function next to y...or is there...

4. Oct 16, 2009

### Dick

There is. P(x)=(-1).

5. Oct 16, 2009

### ch2kb0x

For dy/dx - y = 4e^x, with y(0) = 4.

I got answer: y = (4x + C)e^x

The answer in back says 4e^x (x + 1)

What am I doing wrong?
My Procedure:
P(x) = -1 Q(x) = 4e^x

I = e^-x

Integral both sides = > e^-x(dy/dx -y) = e^(-x) (4e^x)dx

= e^-x y = 4x + c

= y = (4x + c )e^x

6. Oct 16, 2009

### Dick

You didn't use the boundary condition y(0)=4 to find C.