Solve dy/dx= 6e^y sin3x when y=0 and x=0

Lalala

New member
Joined
Jan 12, 2024
Messages
5
Can anyone solve dy/dx= 6e^y sin3x when y=0 and x=0. I cannot get the answer which is y=-ln|-2cosx+3|
 
Yes, I can solve it.
This being a math help forum no one here will solve this problem for you. If you had read the posting guidelines you would have known that.
You say that you can't get the correct answer which implies that you tried. Can you share one of your attempts so that the helpers here can guide you in the right direction as you need to be involved in solving your problem. Note that math is not a spectator sport.
 
Can anyone solve dy/dx= 6e^y sin3x when y=0 and x=0. I cannot get the answer which is y=-ln|-2cosx+3|
Rewriting the problem with latex.

[imath]\displaystyle \frac{dy}{dx} = 6e^y \sin 3x[/imath]

[imath]y(0) = 0[/imath]

You have a typo in your solution!

Notice that when [imath]\displaystyle x = 0[/imath], [imath]\displaystyle y = -\ln 3 \neq 0[/imath]. The initial condition was not satisfied. Therefore the answer should be,

[imath]\displaystyle y = -\ln|-2\cos 3x + 1| = -\ln|2\cos 3x - 1|[/imath]

Or simply

[imath]\displaystyle y = -\ln|2\cos 3x + 1|[/imath]

Both solutions satisfy the differential equation and its initial condition. They differ by a constant.


To answer the original problem, try to rearrange the differential equation in a way that will let you integrate both sides.

Hint: post #3

😎

Bonus exercise. Why are there two solutions? We have learnt in the kindergarten that when the differential equation has initial conditions, it must have a unique solution!
 
Last edited:
[imath]\displaystyle \frac{dy}{dx} = 6e^y \sin 3x[/imath]

[imath]y(0) = 0[/imath]

You have a typo in your solution!

Notice that when [imath]\displaystyle x = 0[/imath], [imath]\displaystyle y = -\ln 3 \neq 0[/imath]. The initial condition was not satisfied. Therefore the answer should be,

[imath]\displaystyle y = -\ln|-2\cos 3x + 1| = -\ln|2\cos 3x - 1|[/imath]

Or simply

[imath]\displaystyle y = -\ln|2\cos 3x + 1|[/imath]

Both solutions satisfy the differential equation and its initial condition. They differ by a constant.
Your check is incorrect. If y = -ln|-2cosx+3|, then y(0) = -ln|-2cos(0)+3| = -ln|-2+3| = -ln(1) = 0.

So the error is not that it doesn't satisfy the initial condition. It's that it doesn't satisfy the differential equation itself, even after inserting the obviously missing 3. There are several problems with the answer as stated.

@Lalala, please show us an image of the actual problem and provided answer, so we can be sure where the error comes from.
 
Rewriting the problem with latex.

[imath]\displaystyle \frac{dy}{dx} = 6e^y \sin 3x[/imath]

[imath]y(0) = 0[/imath]

You have a typo in your solution!

Notice that when [imath]\displaystyle x = 0[/imath], [imath]\displaystyle y = -\ln 3 \neq 0[/imath]. The initial condition was not satisfied. Therefore the answer should be,

[imath]\displaystyle y = -\ln|-2\cos 3x + 1| = -\ln|2\cos 3x - 1|[/imath]

Or simply

[imath]\displaystyle y = -\ln|2\cos 3x + 1|[/imath]

Both solutions satisfy the differential equation and its initial condition. They differ by a constant.


To answer the original problem, try to rearrange the differential equation in a way that will let you integrate both sides.

Hint: post #3

😎

Bonus exercise. Why are there two solutions? We have learnt in the kindergarten that when the differential equation has initial conditions, it must have a unique solution!
cos(0)=1, not -1
 
Your check is incorrect. If y = -ln|-2cos3x+3|, then y(0) = -ln|-2cos(0)+3| = -ln|-2+3| = -ln(1) = 0.

So the error is not that it doesn't satisfy the initial condition. It's that it doesn't satisfy the differential equation itself, even after inserting the obviously missing 3. There are several problems with the answer as stated.

@Lalala, please show us an image of the actual problem and provided answer, so we can be sure where the error comes from.
My bad, mixing [imath]\cos 0 \ \text{with} \ \sin 0[/imath]. (This error proves what we have learnt in the kindergarten was correct. The bonus exercise was cancelled.) 😢

It does satisfy the differential equation. I have proved it. Why do you think that it does not satisfy the differential equation?

Note: the OP meant to write [imath]\cos 3x[/imath], not [imath]\cos x[/imath].

In fact, any [imath]y = -\ln|2\cos 3x + C|[/imath], where [imath]C[/imath] is an arbitrary constant, would satisfy the differential equation.


cos(0)=1, not -1
It was a professional error!

🙏
 
It does satisfy the differential equation. I have proved it. Why do you think that it does not satisfy the differential equation?

Note: the OP meant to write [imath]\cos 3x[/imath], not [imath]\cos x[/imath].

In fact, any [imath]y = -\ln|2\cos 3x + C|[/imath], where [imath]C[/imath] is an arbitrary constant, would satisfy the differential equation.
First, there are several different versions of the solution floating around, which has confused me repeatedly as I try to write this up and confirm my thinking; so let's make it clear that I am talking about their solution with the obvious correction, namely y = -ln|-2cos(3x)+3|. You have modified it in a couple different ways, which I am ignoring. It's possible this is confusing you, too; you backed off from your claim that there are two solutions, one of them presumably being this one, but you still seem to say that it does satisfy the equation. I can only guess that you are not referring to this function.

Here is what I said:
Your check is incorrect. If y = -ln|-2cosx+3|, then y(0) = -ln|-2cos(0)+3| = -ln|-2+3| = -ln(1) = 0.

So the error is not that it doesn't satisfy the initial condition. It's that it doesn't satisfy the differential equation itself, even after inserting the obviously missing 3. There are several problems with the answer as stated.
My claim is that this, even with the correction, namely y = -ln|-2cos(3x)+3|, does not satisfy the differential equation.

If the argument of the absolute value were negative (which never happens), we would have -ln(2cos(3x)-3), whose derivative is (6 sin(3x))/(2 cos(3x) - 3) = 6 sin(3x)e^y. This would satisfy the equation, but is not valid. Possibly this is what you did.

When the argument of the absolute value is positive (as in fact it always is), we have -ln(-2cos(3x)+3), which satisfies the initial condition; its derivative is -(6 sin(3x))/(3 - 2 cos(3x)) = -6 sin(3x)e^y. Thus it does not satisfy the equation; the sign is wrong.

I've been checking everything with Wolfram Alpha, to make sure I am not doing something stupid. It gives the solution for the problem as y(x) = -log(2 cos(3x) - 1); this agrees with my result, and (I think) yours.

Here are the graphs of the claimed solution (blue) and the actual solution (red):

1713648377298.png

It should be clear that they don't both satisfy the same differential equation, though they do both satisfy the initial condition.

I think the absolute value in both your solution and the given one is wrong. Here are your solutions for C = -2, -1, 0, 1, 2, 3, 4:

1713649463947.png

These clearly do not all satisfy the same differential equation. And they include the claimed solution (blue).

Here is what we get without the absolute value, which is WA's general solution (and mine):

1713649669039.png

Now can you show your proof? I'm expecting that you proved something other than what I understand you to be saying.
 
First, there are several different versions of the solution floating around, which has confused me repeatedly as I try to write this up and confirm my thinking; so let's make it clear that I am talking about their solution with the obvious correction, namely y = -ln|-2cos(3x)+3|. You have modified it in a couple different ways, which I am ignoring. It's possible this is confusing you, too; you backed off from your claim that there are two solutions, one of them presumably being this one, but you still seem to say that it does satisfy the equation. I can only guess that you are not referring to this function.

Here is what I said:

My claim is that this, even with the correction, namely y = -ln|-2cos(3x)+3|, does not satisfy the differential equation.

If the argument of the absolute value were negative (which never happens), we would have -ln(2cos(3x)-3), whose derivative is (6 sin(3x))/(2 cos(3x) - 3) = 6 sin(3x)e^y. This would satisfy the equation, but is not valid. Possibly this is what you did.

When the argument of the absolute value is positive (as in fact it always is), we have -ln(-2cos(3x)+3), which satisfies the initial condition; its derivative is -(6 sin(3x))/(3 - 2 cos(3x)) = -6 sin(3x)e^y. Thus it does not satisfy the equation; the sign is wrong.

I've been checking everything with Wolfram Alpha, to make sure I am not doing something stupid. It gives the solution for the problem as y(x) = -log(2 cos(3x) - 1); this agrees with my result, and (I think) yours.

Here are the graphs of the claimed solution (blue) and the actual solution (red):


It should be clear that they don't both satisfy the same differential equation, though they do both satisfy the initial condition.

I think the absolute value in both your solution and the given one is wrong. Here are your solutions for C = -2, -1, 0, 1, 2, 3, 4:


These clearly do not all satisfy the same differential equation. And they include the claimed solution (blue).

Here is what we get without the absolute value, which is WA's general solution (and mine):


Now can you show your proof? I'm expecting that you proved something other than what I understand you to be saying.
Thank you a lot Dr.Peterson for taking my claim seriously. This lengthy explanation is very important and I will have to read it multiple times to grasp it all.

My proof is simple. If [imath]\displaystyle \frac{dy}{dx} = f(x,y)[/imath] is the derivative of the function [imath]y = f(x)[/imath], then [imath]y[/imath] is the solution to the differential equation. Trivial so far.

Lemma: If [imath]\displaystyle y = |x|[/imath], then [imath]\displaystyle \frac{dy}{dx} = \frac{x}{|x|} \frac{d}{dx}(x) = \frac{x}{|x|}[/imath]


If we have [imath]\displaystyle y = -\ln|-2\cos 3x + 3| = -\ln|2\cos 3x - 3|[/imath], then


[imath]\displaystyle \frac{dy}{dx} = \frac{-1}{|2\cos 3x - 3|}\frac{d}{dx}(|2\cos 3x - 3|) = \frac{-1}{|2\cos 3x - 3|}\frac{2\cos 3x - 3}{|2\cos 3x - 3|}\frac{d}{dx}(2\cos 3x - 3)[/imath]


[imath]\displaystyle = -\frac{2\cos 3x - 3}{(2\cos 3x - 3)^2}\frac{d}{dx}(2\cos 3x - 3) = -\frac{1}{2\cos 3x - 3}\frac{d}{dx}(2\cos 3x - 3)[/imath]


[imath]\displaystyle = \frac{6\sin 3x}{2\cos 3x - 3} [/imath]


[imath]\displaystyle \ln\left|\frac{dy}{dx}\right| = \ln\left|\frac{6\sin 3x}{2\cos 3x - 3}\right| = \ln|6\sin 3x| - \ln|2\cos 3x - 3|[/imath]


[imath]\displaystyle \ln\left|\frac{dy}{dx}\right| = \ln|6\sin 3x| + y[/imath]


[imath]\displaystyle \frac{dy}{dx} = 6\sin 3x \ e^y[/imath]
 
Thank you a lot Dr.Peterson for taking my claim seriously. This lengthy explanation is very important and I will have to read it multiple times to grasp it all.

My proof is simple. If [imath]\displaystyle \frac{dy}{dx} = f(x,y)[/imath] is the derivative of the function [imath]y = f(x)[/imath], then [imath]y[/imath] is the solution to the differential equation. Trivial so far.

Lemma: If [imath]\displaystyle y = |x|[/imath], then [imath]\displaystyle \frac{dy}{dx} = \frac{x}{|x|} \frac{d}{dx}(x) = \frac{x}{|x|}[/imath]


If we have [imath]\displaystyle y = -\ln|-2\cos 3x + 3| = -\ln|2\cos 3x - 3|[/imath], then


[imath]\displaystyle \frac{dy}{dx} = \frac{-1}{|2\cos 3x - 3|}\frac{d}{dx}(|2\cos 3x - 3|) = \frac{-1}{|2\cos 3x - 3|}\frac{2\cos 3x - 3}{|2\cos 3x - 3|}\frac{d}{dx}(2\cos 3x - 3)[/imath]


[imath]\displaystyle = -\frac{2\cos 3x - 3}{(2\cos 3x - 3)^2}\frac{d}{dx}(2\cos 3x - 3) = -\frac{1}{2\cos 3x - 3}\frac{d}{dx}(2\cos 3x - 3)[/imath]


[imath]\displaystyle = \frac{6\sin 3x}{2\cos 3x - 3} [/imath]


[imath]\displaystyle \ln\left|\frac{dy}{dx}\right| = \ln\left|\frac{6\sin 3x}{2\cos 3x - 3}\right| = \ln|6\sin 3x| - \ln|2\cos 3x - 3|[/imath]


[imath]\displaystyle \ln\left|\frac{dy}{dx}\right| = \ln|6\sin 3x| + y[/imath]


[imath]\displaystyle \frac{dy}{dx} = 6\sin 3x \ e^y[/imath]
Check those final lines:

[imath]\displaystyle \ln\left|\frac{dy}{dx}\right| = \ln|6\sin 3x| + y[/imath]​
[imath]\displaystyle \frac{dy}{dx} = 6\sin 3x \ e^y[/imath]​

The last line clearly should be

[imath]\displaystyle \left|\frac{dy}{dx}\right| = 6\sin 3x \ e^y[/imath]​

from which we can conclude

[imath]\displaystyle \frac{dy}{dx} = \pm6\sin 3x \ e^y[/imath]​

You haven't determined its sign, which is exactly where I showed the error lies.

Here's another graph:

1713659846280.png

Blue is your claimed solution, [imath]\displaystyle f(x) = -\ln|-2\cos 3x + 3|[/imath]; green is f'(x) as determined by Desmos; and red is [imath]\displaystyle6e^{f\left(x\right)}\sin\left(3x\right)[/imath], which ought to be the same. Instead, it has the opposite sign.

Here is the same set of graphs for the actual solution, [imath]\displaystyle g(x) = -\ln(2\cos(3x) - 1)[/imath]:

1713660333212.png

I had to make the red curve dotted so you can see it; it is identical to g'(x), just as it should be.

Again, consider the fact that [imath]\displaystyle -\ln|-2\cos 3x + 3|[/imath] is equal to [imath]\displaystyle -\ln(-2\cos 3x + 3)[/imath]; take its derivative for yourself and see.
 
Small correction:
The last line clearly should be

[imath]\displaystyle \left|\frac{dy}{dx}\right| = \left|6\sin 3x\right| \ e^y[/imath]​

from which we can conclude

[imath]\displaystyle \frac{dy}{dx} = \pm6\sin 3x \ e^y[/imath]​
I omitted the absolute value on the right, which doesn't affect the result.
 
Check those final lines:

[imath]\displaystyle \ln\left|\frac{dy}{dx}\right| = \ln|6\sin 3x| + y[/imath]​
[imath]\displaystyle \frac{dy}{dx} = 6\sin 3x \ e^y[/imath]​

The last line clearly should be

[imath]\displaystyle \left|\frac{dy}{dx}\right| = 6\sin 3x \ e^y[/imath]​

from which we can conclude

[imath]\displaystyle \frac{dy}{dx} = \pm6\sin 3x \ e^y[/imath]​

You haven't determined its sign, which is exactly where I showed the error lies.

Here's another graph:


Blue is your claimed solution, [imath]\displaystyle f(x) = -\ln|-2\cos 3x + 3|[/imath]; green is f'(x) as determined by Desmos; and red is [imath]\displaystyle6e^{f\left(x\right)}\sin\left(3x\right)[/imath], which ought to be the same. Instead, it has the opposite sign.

Here is the same set of graphs for the actual solution, [imath]\displaystyle g(x) = -\ln(2\cos(3x) - 1)[/imath]:


I had to make the red curve dotted so you can see it; it is identical to g'(x), just as it should be.

Again, consider the fact that [imath]\displaystyle -\ln|-2\cos 3x + 3|[/imath] is equal to [imath]\displaystyle -\ln(-2\cos 3x + 3)[/imath]; take its derivative for yourself and see.
I have read everything you have provided carefully and here is my conclusion.

[imath]y = -\ln|-2\cos 3x + 3|[/imath] does not satisfy the differential equation because it leads to two signs for [imath]\displaystyle \frac{dy}{dx}[/imath].

[imath]y = -\ln(-2\cos 3x + 3)[/imath] does not satisfy the differential equation because it gives [imath]\displaystyle \frac{dy}{dx}[/imath] a negative sign.


[imath]y = -\ln(2\cos 3x - 3)[/imath] is an invalid expression as the logarithmic function does not takes negative values.


The general solution is:

[imath]y = -\ln(2\cos 3x + C)[/imath], where [imath]C[/imath] is an arbitrary constant.

And it would be wrong to say the general solution is [imath]y = -\ln|2\cos 3x + C|[/imath] as it will lead to two signs for [imath]\displaystyle \frac{dy}{dx}[/imath].

Was my conclusion correct? 🤔

If yes, then I have understood your diagrams and explanation. If no, then, I have to revise them again.
 
Top