# alignment is not working.

I tried like this.

\begin{align}

y_{p} &= $$\ \frac{1}{D^2+D} (8cos2x-4sinx)\\$$

&= $$\ \frac{1}{D^2+D} 8cos2x$$ -$$\ \frac{1}{D^2+D} 4sinx\\$$

&= $$\ 8\frac{1}{-4+D}cos2x$$ - $$\ 4\frac{1}{-1+D}sinx \\$$

&= $$\ 8\frac{D+4}{D^2-16}cos2x$$ - $$\ 4\frac{D+1}{D^2-1}sinx\\$$

& = $$\ 8\frac{D+4}{-20}cos2x$$ - $$\ 4\frac{D+1}{-2}sinx\\$$

& = $$\ -\frac{2}{5}(D+4)cos2x$$ + $$\ 2(D+1)sinx\\$$

& = $$\ -\frac{2}{5}(-2sin2x+4cos2x)$$ + $$\ 2(cosx+sinx) \\$$

& = $$\ \frac{4}{5}(sin2x-2cos2x)$$+$$\ 2(sinx+cosx)\\$$ \end{align}
Starting with 'dollar' before begin command and ending with 'dollar' after end command and ending each line with 'double blackslash'.

• You are using it wrong, even on a normal $\rm\LaTeX$ standard, this code is simply wrong. – Asaf Karagila Apr 15 '20 at 19:40
• math.meta.stackexchange.com/questions/5020/… – Asaf Karagila Apr 15 '20 at 19:42
• i watched it. but what were my mistakes? @AsafKaragila – Manjoy Das Apr 15 '20 at 19:43
• You don't need dollars on each line. The minus should be inside your equation, it is a math symbol after all. While we're at it, \cos and \sin are their own commands too. – Asaf Karagila Apr 15 '20 at 19:45
• if i don't write dollars sign in each line then how the fractions or sin, cos etc will work? @AsafKaragila – Manjoy Das Apr 15 '20 at 19:48
• I have edited your post on the main to get to this. I am not sure whether it is close to what you wanted to get. If you still have some questions, feel free to use the MathJax chatroom. – Martin Sleziak Apr 15 '20 at 20:03
• @MartinSleziak yes I wanted exactly this. but how did you find my post? :D – Manjoy Das Apr 15 '20 at 20:04
• From your profile on the main. It is among your recent answers. – Martin Sleziak Apr 15 '20 at 20:05
• can you please tell me what were my mistakes? @MartinSleziak Sometimes it becomes too complicated. – Manjoy Das Apr 15 '20 at 20:07
• I left some comments on that in chat. – Martin Sleziak Apr 15 '20 at 20:12