Logarithmic Differentiation of y=sin(x^(cos(x^2))) (can't get Wolfram Alpha's answer)

debased

New member
Joined
Oct 19, 2018
Messages
28
I'm stuck on a Calc 1 problem that involves logarithmic differentiation somehow. The problem is y=sin(x^(cos(x^2))) and I just can't seem to get the answer that WolframAlpha reaches. The best answer I've come up with is -cos(x^cos(x^2))) * cos(x^2) * x^(cos(x^2)-1) * sin(x^2) * 2x. Any ideas?
 
I'm stuck on a Calc 1 problem that involves logarithmic differentiation somehow. The problem is y=sin(x^(cos(x^2))) and I just can't seem to get the answer that WolframAlpha reaches. The best answer I've come up with is -cos(x^cos(x^2))) * cos(x^2) * x^(cos(x^2)-1) * sin(x^2) * 2x. Any ideas?

What was the form of the equation immediately before and immediately after applying the logarithm?
 
What was the form of the equation immediately before and immediately after applying the logarithm?

So the question is asking to find the derivative of y=sin(x^(cos(x^2))). After applying the logarithm, I get ln(y) = ln(sin(x^cos(x^2)))).
 
I'm stuck on a Calc 1 problem that involves logarithmic differentiation somehow. The problem is y=sin(x^(cos(x^2))) and I just can't seem to get the answer that WolframAlpha reaches. The best answer I've come up with is -cos(x^cos(x^2))) * cos(x^2) * x^(cos(x^2)-1) * sin(x^2) * 2x. Any ideas?

I don't see a sum in your version, so perhaps you either miscopied, or you failed to use the product rule where it was needed.

I do see pieces of what I got (and what they get) in your work, so you did something right. You need to know that implicit differentiation can give very different-looking results if you take any shortcuts or make other variations, so it is also possible that you just did something a little different (though this kind is more straightforward than general implicit differentiation). Perhaps you did something to try to avoid the product.

Please show your work, so we can see what to suggest.
 
I don't see a sum in your version, so perhaps you either miscopied, or you failed to use the product rule where it was needed.

I do see pieces of what I got (and what they get) in your work, so you did something right. You need to know that implicit differentiation can give very different-looking results if you take any shortcuts or make other variations, so it is also possible that you just did something a little different (though this kind is more straightforward than general implicit differentiation). Perhaps you did something to try to avoid the product.

Please show your work, so we can see what to suggest.

I'll try to show my work below, hopefully you can read it:

y = sin(x^cos(x^2))

ln y = ln sin(x^cos(x^2))

d/dx(ln y) = d/dx(ln sin(x^cos(x^2)))

1/y * dy/dx = d/dx(ln sin(x^cos(x^2))) * d/dx(sin(x^cos(x^2))) * d/dx(x^cos(x^2)) * d/dx(cos(x^2)) * d/dx(x^2)

1/y * dy/dx = 1/sin(x^cos(x^2)) * cos(x^cos(x^2)) * cos(x^2)x^(cos(x^2)-1) * -sin(x^2) * 2x

dy/dx = 1/sin(x^cos(x^2)) * cos(x^cos(x^2)) * cos(x^2)x^(cos(x^2)-1) * -sin(x^2) * 2x * y

dy/dx = 1/sin(x^cos(x^2)) * cos(x^cos(x^2)) * cos(x^2)x^(cos(x^2)-1) * -sin(x^2) * 2x * sin(x^cos(x^2))

dy/dx = cos(x^cos(x^2)) * cos(x^2)* -sin(x^2) * 2x^(cos(x^2))
 
I'll try to show my work below, hopefully you can read it:

y = sin(x^cos(x^2))

ln y = ln sin(x^cos(x^2))

d/dx(ln y) = d/dx(ln sin(x^cos(x^2)))

1/y * dy/dx = d/dx(ln sin(x^cos(x^2))) * d/dx(sin(x^cos(x^2))) * d/dx(x^cos(x^2)) * d/dx(cos(x^2)) * d/dx(x^2)

1/y * dy/dx = 1/sin(x^cos(x^2)) * cos(x^cos(x^2)) * cos(x^2)x^(cos(x^2)-1) * -sin(x^2) * 2x

dy/dx = 1/sin(x^cos(x^2)) * cos(x^cos(x^2)) * cos(x^2)x^(cos(x^2)-1) * -sin(x^2) * 2x * y

dy/dx = 1/sin(x^cos(x^2)) * cos(x^cos(x^2)) * cos(x^2)x^(cos(x^2)-1) * -sin(x^2) * 2x * sin(x^cos(x^2))

dy/dx = cos(x^cos(x^2)) * cos(x^2)* -sin(x^2) * 2x^(cos(x^2))

Ok, I see now. Taking the log of the equation as it stands doesn't help anything; if anything, it gets in the way. Logarithmic differentiation is used when taking a log simplifies the equation, not just because someone told you to!

What I did was first to take the inverse sine of each side:

y = sin(x^cos(x^2))

sin^(-1)(y) = x^cos(x^2)

Now we have a power, which the log will dismantle:

ln(sin^(-1)(y)) = ln(x^cos(x^2))

See what you can do starting there.

As a side comment, although you did the right things in most places, the notation in red is improper; you are really taking the derivative with respect to some intermediate function "u" in each case. It's incorrect to write the chain rule that way.

The main error you made is exactly what logarithmic differentiation is intended to make unnecessary, namely differentiating a power with the variable in both the base and the exponent. For a function of the form u^v, where u and v are functions of x, logarithmic differentiation yields this:

y = u^v
ln(y) = v ln(u)
y'/y = v*1/u*u' + v'*ln(u) = u'v/u + ln(u)v'
y' = (u^v)(u'v/u) + (u^v)ln(u)v'
y' = vu^(v-1)u' + ln(u)v'u^v

This is a formula you could in principle memorize and apply to functions like x^cos(x^2), but logarithmic differentiation lets you avoid that mess. Notice that what you wrote amounts to just the first term of this formula, missing the fact that the exponent is not constant.
 
Ok, I see now. Taking the log of the equation as it stands doesn't help anything; if anything, it gets in the way. Logarithmic differentiation is used when taking a log simplifies the equation, not just because someone told you to!

What I did was first to take the inverse sine of each side:

y = sin(x^cos(x^2))

sin^(-1)(y) = x^cos(x^2)

Now we have a power, which the log will dismantle:

ln(sin^(-1)(y)) = ln(x^cos(x^2))

See what you can do starting there.

As a side comment, although you did the right things in most places, the notation in red is improper; you are really taking the derivative with respect to some intermediate function "u" in each case. It's incorrect to write the chain rule that way.

The main error you made is exactly what logarithmic differentiation is intended to make unnecessary, namely differentiating a power with the variable in both the base and the exponent. For a function of the form u^v, where u and v are functions of x, logarithmic differentiation yields this:

y = u^v
ln(y) = v ln(u)
y'/y = v*1/u*u' + v'*ln(u) = u'v/u + ln(u)v'
y' = (u^v)(u'v/u) + (u^v)ln(u)v'
y' = vu^(v-1)u' + ln(u)v'u^v

This is a formula you could in principle memorize and apply to functions like x^cos(x^2), but logarithmic differentiation lets you avoid that mess. Notice that what you wrote amounts to just the first term of this formula, missing the fact that the exponent is not constant.

Thanks! Looks like I got stuck again, let me post to where I got to:

y = sin(x^(cos(x^2)))

sin^(-1)(y) = x^cos(x^2)

ln( sin^(-1)(y) ) = ln( x^cos(x^2) )

1/(sin^(-1)(y)) * 1/(sqrt(1-y^2)) * dy/dx = cos(x^2) * 1/x + lnx * -sin(x^2) * 2x

1/(x^(cos(x^2))) * 1/(sqrt(1-sin^2(x^(cos(x^2))))) * dy/dx = cos(x^2) * 1/x - lnx * sin(x^2) * 2x

1/(sqrt(1-sin^2(x^(cos(x^2))))) * dy/dx = x^(cos(x^2)) * (cos(x^2) * 1/x - lnx * sin(x^2) * 2x)


Not sure how Wolfram gets it's answer: x^(-1 + cos(x^2)) cos(x^cos(x^2)) (cos(x^2) - 2 x^2 log(x) sin(x^2)) from where I am. I can distribute and mess with some exponents but I'm not sure what to do with the 1/root on the left side.
 
Thanks! Looks like I got stuck again, let me post to where I got to:

y = sin(x^(cos(x^2)))

sin^(-1)(y) = x^cos(x^2)

ln( sin^(-1)(y) ) = ln( x^cos(x^2) )

1/(sin^(-1)(y)) * 1/(sqrt(1-y^2)) * dy/dx = cos(x^2) * 1/x + lnx * -sin(x^2) * 2x

1/(x^(cos(x^2))) * 1/(sqrt(1-sin^2(x^(cos(x^2))))) * dy/dx = cos(x^2) * 1/x - lnx * sin(x^2) * 2x

1/(sqrt(1-sin^2(x^(cos(x^2))))) * dy/dx = x^(cos(x^2)) * (cos(x^2) * 1/x - lnx * sin(x^2) * 2x)


Not sure how Wolfram gets it's answer: x^(-1 + cos(x^2)) cos(x^cos(x^2)) (cos(x^2) - 2 x^2 log(x) sin(x^2)) from where I am. I can distribute and mess with some exponents but I'm not sure what to do with the 1/root on the left side.

Don't miss the fact that sqrt(1-sin^2(x^(cos(x^2)))) = cos(x^(cos(x^2))), since in general sqrt(1-sin^2(u)) = cos(u), given that u is in the first or fourth quadrant, as it is here. Then just multiply both sides by this denominator.

What I got from Wolfram was
y'(x) = x^(cos(x^2) - 1) cos(x^cos(x^2)) (cos(x^2) - 2 x^2 log(x) sin(x^2))That first factor, x^(cos(x^2) - 1), is x^cos(x^2) / x, which matches what you have. Try expanding their version before comparing to yours.
 
Don't miss the fact that sqrt(1-sin^2(x^(cos(x^2)))) = cos(x^(cos(x^2))), since in general sqrt(1-sin^2(u)) = cos(u), given that u is in the first or fourth quadrant, as it is here. Then just multiply both sides by this denominator.

What I got from Wolfram was
y'(x) = x^(cos(x^2) - 1) cos(x^cos(x^2)) (cos(x^2) - 2 x^2 log(x) sin(x^2))That first factor, x^(cos(x^2) - 1), is x^cos(x^2) / x, which matches what you have. Try expanding their version before comparing to yours.

Awesome, looks like I got it from your advice. My simplified form of: x^cos(x^2) * cos (x^(cos(x^2))) (cos(x^2)/x - 2xlnxsin(x^2)) looks better to me than Wolfram's simplified form. I do have one last question; how did you know u was in the first or fourth quadrant? My trigonometry is a little bit shake-y as I did not learn it in the best way.
 
Awesome, looks like I got it from your advice. My simplified form of: x^cos(x^2) * cos (x^(cos(x^2))) (cos(x^2)/x - 2xlnxsin(x^2)) looks better to me than Wolfram's simplified form. I do have one last question; how did you know u was in the first or fourth quadrant? My trigonometry is a little bit shake-y as I did not learn it in the best way.

Actually, I wasn't fully thinking there. If it had been given in the form sin-1(y) = ..., that would imply the quadrants, as the inverse sine is always in those quadrants. But really, I was just trusting that Wolfram got it right!

Looking back at the problem itself, I see that we're talking about the sine of x^(cos(x^2), which is conceivably very weird; for one thing, x can't be negative or horrible things happen. So we're probably not expected to worry about this detail.

In fact, try graphing x^(cos(x^2) and sin(x^(cos(x^2)) (at Desmos.com, for example), and prepare to be dazzled! No quadrant is off limits. So we may find that the sign of our derivative is wrong occasionally.
 
Top