solve differential equation using given substitution Solve the following equation by making substitution
$$y=xz^n \text{ or } z=\frac{y}{x^n}$$
and choosing a convenient value of n.
$$\frac{dy}{dx}= \frac{2y}{x} +\frac{x^3}{y} +x\tan\frac{y}{x^2}$$
I thought it can be solved in 2 ways
1.making it exact differential equation
2.making it linear differential equation
But I do not understand when i will do substitution.
Please help me solve this question.

Since the ODE has the term $x\tan\dfrac{y}{x^2}$ present, so it is obviously to choose $n=2$ .
Let $z=\dfrac{y}{x^2}$ ,
Then $y=x^2z$
$\dfrac{dy}{dx}=x^2\dfrac{dz}{dx}+2xz$
$\therefore x^2\dfrac{dz}{dx}+2xz=2xz+\dfrac{x}{z}+x\tan z$
$x^2\dfrac{dz}{dx}=x\left(\dfrac{1}{z}+\tan z\right)$
$\dfrac{dx}{x}=\dfrac{z}{z\tan z+1}dz$
$\int\dfrac{dx}{x}=\int\dfrac{z}{z\tan z+1}dz$
$\int\dfrac{dx}{x}=\int\dfrac{z\cos z}{z\sin z+\cos z}dz$
$\int\dfrac{dx}{x}=\int\dfrac{d(z\sin z+\cos z)}{z\sin z+\cos z}$
$\ln x=\ln(z\sin z+\cos z)+c$
$x=C(z\sin z+\cos z)$
$x=C\left(\dfrac{y}{x^2}\sin\dfrac{y}{x^2}+\cos\dfrac{y}{x^2}\right)$
