Show solutionHide solution
Let \(y=(x\cos x)^x+(x\sin x)^{1/x}=u+v\), where \(u=(x\cos x)^x\) and \(v=(x\sin x)^{1/x}\). We differentiate each term separately and add.
First term \(u=(x\cos x)^x\). Taking logarithms (valid where \(x\cos x>0\)):
\[ \ln u=x\ln(x\cos x). \] Differentiating both sides with respect to \(x\), using the product rule on the right and the chain rule on \(\ln(x\cos x)\): \[ \frac{1}{u}\frac{du}{dx}=\ln(x\cos x)+x\cdot\frac{1}{x\cos x}\cdot(\cos x-x\sin x). \] Since \(\frac{d}{dx}(x\cos x)=\cos x-x\sin x\), this becomes \[ \frac{1}{u}\frac{du}{dx}=\ln(x\cos x)+\frac{\cos x-x\sin x}{\cos x}=\ln(x\cos x)+1-x\tan x. \] Hence \[ \frac{du}{dx}=(x\cos x)^x\bigl[\ln(x\cos x)+1-x\tan x\bigr]. \]Second term \(v=(x\sin x)^{1/x}\). Taking logarithms (valid where \(x\sin x>0\)):
\[ \ln v=\frac{1}{x}\ln(x\sin x). \] Differentiate using the product rule on \(\frac{1}{x}\ln(x\sin x)\): \[ \frac{1}{v}\frac{dv}{dx}=-\frac{1}{x^2}\ln(x\sin x)+\frac{1}{x}\cdot\frac{1}{x\sin x}\cdot(\sin x+x\cos x). \] Since \(\frac{d}{dx}(x\sin x)=\sin x+x\cos x\), the second piece simplifies to \[ \frac{1}{x}\cdot\frac{\sin x+x\cos x}{x\sin x}=\frac{\sin x+x\cos x}{x^2\sin x}=\frac{1}{x^2}+\frac{\cot x}{x}. \] Therefore \[ \frac{1}{v}\frac{dv}{dx}=-\frac{\ln(x\sin x)}{x^2}+\frac{1}{x^2}+\frac{\cot x}{x}, \] so \[ \frac{dv}{dx}=(x\sin x)^{1/x}\left[\frac{1-\ln(x\sin x)}{x^2}+\frac{\cot x}{x}\right]. \]Combining. Since \(y=u+v\),
\[ \boxed{\frac{dy}{dx}=(x\cos x)^x\bigl[\ln(x\cos x)+1-x\tan x\bigr]+(x\sin x)^{1/x}\left[\frac{1-\ln(x\sin x)}{x^2}+\frac{\cot x}{x}\right]}. \]This formula applies on the domain where the original powers are defined as real functions, i.e. where \(x\cos x>0\) and \(x\sin x>0\) (and \(x\neq 0\)); at points where a base is zero or negative the real-valued power is not defined in the usual sense, so those points are excluded.