Suppose an incident light from vacuum ($n_1=1.0$) into some media ($n_2=n_1+\mu\; x^2$) as in the figure below.
How to calculate the refracted light path curve in closed form?
Update:
Try to set up ordinary differential equation for the refracted light path per Snell's law.
Suppose the curve is $y=y(x)$;
Since $n_i \sin\theta_i=\text{constant}=n_1\sin\alpha=\sin\alpha$.
For any point $P:(x_0,y(x_0))$ on the path $y(x)$, we have: $$\tan(\theta_P)=\dfrac{\sin\theta_P}{\cos\theta_P}=y'(x)=\dfrac{\rm{d}y}{\rm{d}x},\quad \text{where }\theta_P \text{ is incident / refracted angle}$$
Since $\theta_P$ is always an acute angle, we have:
$$\dfrac{\sin^2\theta_P}{{1-\sin^2\theta_P}}=y'(x)^2\Rightarrow \sin\theta_P=\dfrac{\pm y'(x)}{\sqrt{1+y'(x)^2}}$$
Clearly $n_P\sin\theta_P=\sin\alpha$, where $n_P=1+\mu x^2$, then we have:
$$\left(1+\mu x^2\right)\dfrac{\pm y'(x)}{\sqrt{1+y'(x)^2}}=\sin\alpha\quad\text{with: y(0)=5} ||y'(0)=\tan\alpha$$
Then it becomes how to solve the ODE with a boundary condition. Can the ODE be solved in closed form?