Very nice
And just to finish off by showing you how the result of the substitution we made came to be:
a\cdot\cos\theta+b\cdot\sin\theta=R\sin\left(\theta+\phi\right)
RHS=R(\sin\theta\cos\phi+\cos\theta\sin\phi)
Since we want to solve for \theta, we can equate the coefficients of \cos\theta from each side, and also for \sin\theta.
a\cdot\cos\theta \equiv R\cos\theta\sin\phi
a = R\sin\phi
and
b\cdot\sin\theta \equiv R\sin\theta\cos\phi
b=R\cos\phi
So now we have these two equations in 2 unknowns (R and \phi) and can thus solve them simultaneously. We can solve for \phi by dividing the first equation by the second to get
\frac{a}{b}=\tan\phi
\phi=\tan^{-1}\frac{a}{b}
and plugging this back into the first or second equation, we get
a=R\sin\left(\tan^{-1}\frac{a}{b}\right)
and by playing around with this and applying trig substitutions (I myself prefer using a right triangle), you can determine that
\sin(\tan^{-1}x)=\frac{x}{\sqrt{x^2+1}}
And so
R=\frac{a\sqrt{x^2+1}}{x}
=\frac{a\sqrt{\frac{a^2}{b^2}+1}}{\frac{a}{b}}
=\frac{\frac{a}{b}\sqrt{a^2+b^2}}{\frac{a}{b}}
=\sqrt{a^2+b^2}
as required.