<s>[INST] 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.
 [/INST] 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. 
</s>