Question:medium

If \(y = x^{x\cos x}\), then evaluate \(\dfrac{dy}{dx}\).

Show Hint

Take logs: \(\log y = x\cos x\,\log x\). Differentiate using the product rule, then multiply by \(y\).
Updated On: Nov 19, 2026
Show Solution

Solution and Explanation

Step 1: Rewrite with base $e$.
Any positive function raised to a function can be written as an exponential: $u^{v} = e^{v\ln u}$. For $x \gt 0$,
\[ y = x^{x\cos x} = e^{\,x\cos x\,\ln x} \]

Step 2: Differentiate the exponential.
The derivative of $e^{g(x)}$ is $e^{g(x)}\cdot g'(x)$. Here $g(x) = x\cos x\,\ln x$, so
\[ \frac{dy}{dx} = e^{\,x\cos x\,\ln x}\cdot g'(x) = x^{x\cos x}\, g'(x) \]

Step 3: Find $g'(x)$ with the product rule for three factors.
For $g = pqr$ with $p = x$, $q = \cos x$, $r = \ln x$, we use $g' = p'qr + pq'r + pqr'$.
Here $p' = 1$, $q' = -\sin x$, $r' = \dfrac1x$.
\[ g'(x) = 1\cdot\cos x\ln x + x(-\sin x)\ln x + x\cos x\cdot\frac1x \]
\[ g'(x) = \cos x\ln x - x\sin x\ln x + \cos x \]

Step 4: Group the terms.
Take $\ln x$ common from the first two terms.
\[ g'(x) = (\cos x - x\sin x)\ln x + \cos x \]
The last term came from $x\cos x\cdot\dfrac1x$, where the $x$ cancels.

Step 5: Combine.
\[ \frac{dy}{dx} = x^{x\cos x}\Big[(\cos x - x\sin x)\ln x + \cos x\Big] \]

Final Answer:
Both routes give the same derivative. \[ \boxed{\frac{dy}{dx} = x^{x\cos x}\Big[(\cos x - x\sin x)\ln x + \cos x\Big]} \]
Was this answer helpful?
0