We are given the parametric equations:
\[
x = a(\cos\theta + \theta\sin\theta), \quad y = a(\sin\theta - \theta\cos\theta).
\]
Step 1: Calculate \(\frac{dx}{d\theta}\)
Differentiating \( x \) with respect to \(\theta\):
\[
\frac{dx}{d\theta} = a\left(-\sin\theta + \theta\cos\theta + \sin\theta + \theta\cos\theta\right).
\]
Simplifying:
\[
\frac{dx}{d\theta} = a\theta\cos\theta.
\]
Step 2: Calculate \(\frac{dy}{d\theta}\)
Differentiating \( y \) with respect to \(\theta\):
\[
\frac{dy}{d\theta} = a\left(\cos\theta + \theta(-\sin\theta) - \cos\theta - \theta(-\sin\theta)\right).
\]
Simplifying:
\[
\frac{dy}{d\theta} = a\theta\sin\theta.
\]
Step 3: Calculate \(\frac{dy}{dx}\)
Using the chain rule, we have:
\[
\frac{dy}{dx} = \frac{\frac{dy}{d\theta}}{\frac{dx}{d\theta}}.
\]
Substitute the values:
\[
\frac{dy}{dx} = \frac{a\theta\sin\theta}{a\theta\cos\theta} = \tan\theta.
\]
Step 4: Calculate \(\frac{d^2y}{dx^2}\)
Differentiate \(\frac{dy}{dx} = \tan\theta\) with respect to \( x \):
\[
\frac{d^2y}{dx^2} = \frac{d}{dx}(\tan\theta).
\]
Using the chain rule:
\[
\frac{d^2y}{dx^2} = \sec^2\theta \cdot \frac{d\theta}{dx}.
\]
From Step 1, we know:
\[
\frac{dx}{d\theta} = a\theta\cos\theta \quad \Rightarrow \quad \frac{d\theta}{dx} = \frac{1}{a\theta\cos\theta}.
\]
Substitute:
\[
\frac{d^2y}{dx^2} = \sec^2\theta \cdot \frac{1}{a\theta\cos\theta}.
\]
Simplifying:
\[
\frac{d^2y}{dx^2} = \frac{\sec^3\theta}{a\theta}.
\]
Final Answer:
\[
\boxed{\frac{\sec^3\theta}{a\theta} }.
\]