Key idea: Rationalise the fraction inside the logarithm first, so that the square roots of a+x and a−x combine into one root a2−x2. Then split the logarithm, differentiate each part, and simplify. We take a>0 and 0<x<a, so that every root is real and the fraction is positive.
Step 1 — Rationalise the fraction.
We multiply the numerator and the denominator by a+x+a−x. The denominator becomes a difference of squares, and the numerator becomes a perfect square.
The new numerator is the square of the sum, expanded with (p+q)2=p2+2pq+q2.
(a+x+a−x)2=(a+x)+2a+xa−x+(a−x)=2a+2a2−x2
The new denominator is a difference of squares, (p−q)(p+q)=p2−q2.
(a+x−a−x)(a+x+a−x)=(a+x)−(a−x)=2x
So the fraction inside the logarithm is
2x2a+2a2−x2=xa+a2−x2
Step 2 — Split the logarithm.
Both a+a2−x2 and x are positive, so the quotient law of logarithms applies.
y=log(a+a2−x2)−logx
Step 3 — Differentiate the first logarithm.
The derivative of a2−x2 is a2−x2−x, so the chain rule gives the product below.
dxdlog(a+a2−x2)=a+a2−x21⋅a2−x2−x
Step 4 — Simplify this derivative.
We multiply the numerator and the denominator by a−a2−x2, which is positive for 0<x<a. The two brackets then multiply as a difference of squares.