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.
 A: Here is one approach (others may also be possible, but we will use your hint).
We are given:
$$\tag 1 \frac{dy}{dx}= \dfrac{2y}{x} +\dfrac{x^3}{y} +x \tan \frac{y}{x^2}$$
Lets choose the substitution:
$$\tag 2 z = \dfrac{y}{x^2} \rightarrow y = x^2 z$$
Differentiating $(2)$ yields:
$$\tag 3 \dfrac{dy}{dx} = 2x z + x^2 \dfrac{dz}{dx}$$
Substituting $(2)$ into $(1)$ yields:
$$\tag 4 \frac{dy}{dx}= \dfrac{2 x^2 z}{x} +\dfrac{x^3}{x^2 z} +x \tan \frac{x^2 z}{x^2} = 2 x z + \dfrac{x}{z} +x \tan z$$
Now, since we have two expressions for $\dfrac{dy}{dx}$, we can equate $(3)$ and $(4)$, yielding:
$$2x z + x^2 \dfrac{dz}{dx} = 2 x z + \dfrac{x}{z} +x \tan z$$
Simplifying, yields:
$$x^2 \dfrac{dz}{dx} = \dfrac{x}{z} +x \tan z$$
Simplifying yields:
$$\dfrac{dz}{dx} = \dfrac{z \tan z + 1}{x z}$$
This can be written as:
$$\tag 5 \displaystyle \int\dfrac{z ~ dz}{z \tan z + 1} = \int \dfrac{dx}{x}$$
Now, you can integrate each side of $(5)$ and then substitute in for $z$ and you are done.
Upon integrating, you get:
$$ \ln(z \sin z + \cos z) = \ln x + c$$
You have an expression for $z$, substitute and you can simplify a bit. 
A: 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)$
