# Math Help - Diffrential equations...can't seem to get answer =(.

1. ## Diffrential equations...can't seem to get answer =(.

There are two questions, maybe im doing the same mistake or not doing something in both? Idk...

Answer = $
y = 3 - \frac{4}{x^2}
$

Question = Solve for y in terms of x, the differential equation given that x = 2, when y = 2
$x \frac{dy}{dx} = 2(3 - y)$
I dunno what im doing wrong .
$x \frac{dy}{dx} = 2(3 - y)$
So, take over stuff and integrate both sides.
$\int\frac{1}{3-y} = \int\frac{2}{x}$
Gives:
$\ln {3-y} = 2\ln {x} + c$
Rearrange gives $y = 3 - x^2 + c$
Subbing in x = 2 and y = 2 i get c = -3
So my answer is $y = 3 - x^2 - 3$
or $y = x^2$

Which is wrrrrooooonnng lol ..

Question 2:
Given that y = 1 when x = 0, express y in terms of x if
$\frac{dy}{dx} = \frac{e^x}{e^y}$
Now when i take stuff to side and integrate i get
$e^y = e^ x + c$
And therefore y = x + c
Subbing in values gives c = 1
And i get the answer y = x + 1...which fits the co-ordinates but its WRONG. .

The answer is : $y = \ln(e^x + e - 1)$
I have no idea how they get that.

Any help would be really appreciated!
Thank-you very much in advance for anything you can give!

2. For #1) when you integrate 1/(3-y) you forgot to add in a negative sign. When you take the derivative of ln(3-y) by using the chain rule you'll multiply the whole thing by -1 because of the -y, thus when integrating you must compensate for this. That negative applied to 2ln(x) makes the exponent x^(-2) instead of x^2.

3. Originally Posted by AshleyT
Question 2:
Given that y = 1 when x = 0, express y in terms of x if
$\frac{dy}{dx} = \frac{e^x}{e^y}$
Now when i take stuff to side and integrate i get
$e^y = e^ x + c$
And therefore y = x + c
Subbing in values gives c = 1
And i get the answer y = x + 1...which fits the co-ordinates but its WRONG. .

The answer is : $y = \ln(e^x + e - 1)$
I have no idea how they get that.

Any help would be really appreciated!
Thank-you very much in advance for anything you can give!
\begin{aligned}\frac{dy}{dx}&=\frac{e^x}{e^y}\\
&\implies{e^ydy=e^xdx}\\
&\implies{e^y=e^x+c}\\
&\implies\ln(e^y)=y=\ln\left(e^x+c\right)
\end{aligned}

So know we know that

$1=\ln\left(e^0+c\right)=\ln(1+c)$

We know $\ln(x)=1$ when $x=e$. So $1+c=e\Rightarrow{c=e-1}$

$\therefore{y=\ln\left(e^x+e-1\right)}$

4. Ooo.
Thankyou very much for both answers and speedy replies! This is greatly appreciated!!
Thank-you so much!

5. Originally Posted by Math_Helper
Cheers . Ima see if i can have another go though before looking at your solutions .
p.s I might be going to Calgary next year!