∫Calc Practice

Derivative of \( \displaystyle x^{\cos{\left(x \right)}} \)

Problem 2.402 · hard Video

Differentiate \( \displaystyle f(x) = x^{\cos{\left(x \right)}} \).
  1. \[ \frac{d}{d x} x^{\cos{\left(x \right)}} \]
    derivativeStart with the derivative of the function.✓ Proved
  2. \[ = \frac{d}{d x} e^{\ln{\left(x \right)} \cos{\left(x \right)}} \]
    rewriteRewrite the base and exponent using the exponential and logarithm.✓ Checked independently
  3. \[ = e^{\ln{\left(x \right)} \cos{\left(x \right)}} \frac{d}{d x} \ln{\left(x \right)} \cos{\left(x \right)} \]
    chainApply the chain rule for the exponential function.✓ Proved
  4. \[ = \left(\ln{\left(x \right)} \frac{d}{d x} \cos{\left(x \right)} + \cos{\left(x \right)} \frac{d}{d x} \ln{\left(x \right)}\right) e^{\ln{\left(x \right)} \cos{\left(x \right)}} \]
    productApply the product rule to the exponent.✓ Proved
  5. \[ = \left(- \ln{\left(x \right)} \sin{\left(x \right)} + \frac{\cos{\left(x \right)}}{x}\right) e^{\ln{\left(x \right)} \cos{\left(x \right)}} \]
    trigDifferentiate the trigonometric and logarithmic functions.✓ Proved
  6. \[ = x^{\cos{\left(x \right)}} \left(- \ln{\left(x \right)} \sin{\left(x \right)} + \frac{\cos{\left(x \right)}}{x}\right) \]
    algebraSubstitute back the original expression for the exponential part.✓ Checked independently
  7. \[ = - x^{\cos{\left(x \right)}} \ln{\left(x \right)} \sin{\left(x \right)} + \frac{x^{\cos{\left(x \right)}} \cos{\left(x \right)}}{x} \]
    algebraDistribute the term x**cos(x).✓ Proved
  8. \[ = x^{\cos{\left(x \right)} - 1} \cos{\left(x \right)} - x^{\cos{\left(x \right)}} \ln{\left(x \right)} \sin{\left(x \right)} \]
    simplifySimplify the first term by combining the powers of x.✓ Proved
Answer \( x^{\cos{\left(x \right)}} \left(- \log{\left(x \right)} \sin{\left(x \right)} + \frac{\cos{\left(x \right)}}{x}\right) \)
Top: the graph of f = x^cos(x). A tangent line slides along it, and its slope is plotted below as it goes, tracing f' = x^cos(x)·(-log(x)·sin(x) + cos(x)/x).

✓ Nihil obstat Lines: 7 proved, 2 checked by independent solution. The answer was also checked a second way, without looking at the solution. Reviewers found nothing wrong with the explanation. How we verify

The full receipt
LineStatusChecked byDetail
1✓ Provedsympy 1.14.0line 1 is the problem as stated
2✓ Checked independentlyclaude-sonnet-5-5 script, run by sympy 1.14.0, sympy 1.14.0sympy 1.14.0: simplify left (x**cos(x)*(-x*log(x)*sin(x) + cos(x)) + (x*log(x)*sin(x) - cos(x))*exp(log(x)*cos(x)))/x; numeric agreement only, at 24 of 24 sampled points
claude-sonnet-5-5 script, run by sympy 1.14.0: derivatives agree after replacing exp(cos*log p) by p**cos (p>0) (checks/2.402/line2-fcf519bd.py)
log is undefined for non-positive arguments
3✓ Provedsympy 1.14.0simplify(a - b) reduced to 0
log is undefined for non-positive arguments
4✓ Provedsympy 1.14.0simplify(a - b) reduced to 0
log is undefined for non-positive arguments
5✓ Provedsympy 1.14.0simplify(a - b) reduced to 0
log is undefined for non-positive arguments
undefined where x = 0
6✓ Checked independentlyclaude-sonnet-5-5 script, run by sympy 1.14.0, sympy 1.14.0sympy 1.14.0: simplify left (x**cos(x)*(x*log(x)*sin(x) - cos(x)) + (-x*log(x)*sin(x) + cos(x))*exp(log(x)*cos(x)))/x; numeric agreement only, at 24 of 24 sampled points
claude-sonnet-5-5 script, run by sympy 1.14.0: line 5 with exp(cos*log p) replaced by p**cos equals line 6, diff=0 (checks/2.402/line6-a5d358e0.py)
log is undefined for non-positive arguments
undefined where x = 0
7✓ Provedsympy 1.14.0simplify(a - b) reduced to 0
log is undefined for non-positive arguments
undefined where x = 0
8✓ Provedsympy 1.14.0simplify(a - b) reduced to 0
log is undefined for non-positive arguments
undefined where x = 0
answer✓ Provedsympy 1.14.0final line against the stated answer: simplify(a - b) reduced to 0
log is undefined for non-positive arguments
undefined where x = 0
answer, a second way✓ Provedsympy 1.14.0SymPy differentiated f directly and got the stated answer

Reviewers

  • gpt-oss:20b: fail (error) — Step 5 applies two differentiation rules at once (trigonometric and logarithmic) but is labeled only as "trig". Each step must change only one thing and use a single rule name.
  • qwen3.6:27b-mlx: pass

Senior review claude-sonnet-5-5, 2026-10-08: pass — The derivation is correct: rewrite as exp, chain rule, product rule, evaluate derivatives, substitute back, distribute, combine powers. Line 2 and line 6 differ from their predecessors only by x**cos(x) = exp(cos(x)*log(x)), which holds for x>0, and domain restrictions are recorded separately.

  • gpt-oss:20b: dismiss — Step 5 just evaluates the basic derivatives left after the product rule (cos' and log'); 'trig' names a rule actually applied, so this is not a wrong label or a genuinely independent double change.
Every verdict on record (7)
  • claude-sonnet-5-5: pass 2026-10-08 — The derivation is correct: rewrite as exp, chain rule, product rule, evaluate derivatives, substitute back, distribute, combine powers. Line 2 and line 6 differ from their predecessors only by x**cos(x) = exp(cos(x)*log(x)), which holds for x>0, and domain restrictions are recorded separately.
  • qwen3.6:27b-mlx: pass 2026-09-21
  • gpt-oss:20b: fail (error) 2026-09-21 — Step 5 applies two differentiation rules at once (trigonometric and logarithmic) but is labeled only as "trig". Each step must change only one thing and use a single rule name.
  • qwen3.6:27b-mlx: pass 2026-09-20
  • gpt-oss:20b: pass 2026-09-20
  • qwen3.6:27b-mlx: pass 2026-09-20
  • gpt-oss:20b: pass 2026-09-20

Proved: SymPy reduced the difference between the two sides to zero. Checked independently: a separate method, named above, confirmed it. Checked numerically: the two sides agree at every sampled point, which is evidence, not proof. Reviewed: a model or a person read it; that is all a sentence can have. Solution by gemma4:26b, checked 2026-09-26 with SymPy 1.14.0.