I have a problem. My teacher made an online explanation about merging fractions. She wrote the following: $$\frac{1}{x+1}+3$$ Then she wanted that to merge in one fraction, so she did this: $$\frac{1}{x+1}+\frac{3(x+1)}{(x+1)}=\frac{1+3x+3}{x+1}=\frac{3x+4}{x+1}$$
Now I understand why she does this, but calculating with $1$ is easy. In my case I have $24$ like this: $$\frac{24}{x+2}+4$$
How do I write this in one fraction?
$$y=\frac{24}{x+2}+4=\frac{24+4\cdot(x+2)}{x+2}=\frac{24+4x+8}{x+2}=\frac{4x+32}{x+2}$$
Please take in consideration to see some basic LaTeX commands.