I am trying to solve the following differential equation
$$y''=2yy'$$
and ended up with the answer: $$\frac{1}{C_1}\arctan\frac{y}{C_1}+C_2=x.$$
However, the answer should be,
$$\arctan\frac{y}{C_1}+C_2=x.$$
So I tried manipulating my solution in the following way,
$$\left(\frac{1}{C_1}\right)\left(\frac{y}{C_1}\right)=\tan(x-C_2)$$
$$\left(\frac{y}{C_1}\right)=\tan(x-C_2)$$ $$\arctan\frac{y}{C_1}+C_2=x.$$
Which ends up being the correct answer.
Did I break any law of math in the above steps? Or it can't be done that way? This is the only way I can think of on how my professor come up with such answer.
Your first answer is correct. The later manipulation you performed to get the answer you say your teacher came up with is wrong. $$ \left(\frac1{C_1}\right)\left(\frac{y}{C_1}\right)=\tan(x-C_2) $$ does not follow from $$ \frac1{C_1}\arctan\frac{y}{C_1}+C_2=x $$
Additionally, there are two other answers depending on the sign of the constant of integration of the first integration.
Integrating $$ y''=2yy' $$ gives $$ y'=y^2+c_1 $$ Dividing and integrating yields $$ \int\frac{\mathrm{d}y}{y^2+c_1}=\int\mathrm{d}x $$ If $c_1\gt0$, $$ \frac1{\sqrt{c_1}}\tan^{-1}\left(\frac{y}{\sqrt{c_1}}\right)+c_2=x $$ which gives $$ \bbox[5px,border:2px solid #C0A000]{y=a\tan(ax+b)} $$ If $c_1=0$, $$ c_2-\frac1y=x $$ which gives $$ \bbox[5px,border:2px solid #C0A000]{y=\frac1{b-x}} $$ If $c_1\lt0$, $$ -\frac1{\sqrt{-c_1}}\tanh^{-1}\left(\frac{y}{\sqrt{-c_1}}\right)+c_2=x $$ which gives $$ \bbox[5px,border:2px solid #C0A000]{y=-a\tanh(ax+b)} $$