Start by differentiating the given curve \(y = \tan (ax + b)\).
1. First derivative: \(y' = a \sec^2 (ax + b)\).
2. Second derivative: \(y'' = 2a^2 \sec^2 (ax + b) \tan (ax + b)\).
Now, use these to eliminate \(a\) and \(b\) and express the equation in terms of \(y\) and its derivatives. This leads to the differential equation:
\[
(1 + y^2) y'' - 2y' y = 0.
\]