If \( x = a \left( \cos \theta + \log \tan \frac{\theta}{2} \right) \) and \( y = \sin \theta \), then find \( \frac{d^2y}{dx^2} \) at \( \theta = \frac{\pi}{4} \).
Show Hint
When computing second derivatives, always apply the chain rule carefully, and be sure to evaluate at the given point for precise results.