# Splitting equations using \begin{split} generates errors (again)

I have been successfully using "split" to split up long equation, but now I get a new error:

 $$\begin{split} \alpha_0=\frac{1}{\pi}\int_{-\pi}^{\pi}F(y)\text{d}y=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}\text{d}y+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}\text{d}y+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\text{d}y+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}\text{d}t\\ \alpha_0=\frac{5}{2}+\frac{3(\pi-\frac{\pi}{2}){\pi} \end{split}$$


gives a lot of errors

I have tried many version, but can't get that $\alpha_0=\frac{5}{2}+\frac{3(\pi-\frac{\pi}{2}){\pi}$ to start at the second line, to the left...

Any ideas welcomed!

Thanks

• I can't find the \begin{split} in your example... (and to split you use \\, & is for align) Commented Apr 24, 2023 at 13:28
• See update..... Commented Apr 24, 2023 at 13:30
• You have a runaway argument. Check it (writing the formula on different input lines, with logical spacing and indeneting, will help a lot). Commented Apr 24, 2023 at 13:32
• \frac{3(\pi-\frac{\pi}{2}){\pi} is missing a closing brace for the outer fraction's numerator Commented Apr 24, 2023 at 13:33
• Unrelated, don't use \text like that. That is not what \text is for and in certain cases it will produce the wrong result. Use \mathrm{d} etc insted. Commented Apr 24, 2023 at 13:34

\frac{3(\pi-\frac{\pi}{2}){\pi} is giving an unmatched brace (this is presumably the first error you are seeing, and once resolved should fix the subsequent errors) and should probably be \frac{3(\pi-\frac{\pi}{2})}{\pi}.

Preferring \mathrm{d} (Is there a preference of when to use \text and \mathrm?), then you simply need to set an alignment point on the first equals sign

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\begin{split} \alpha_0 &= \frac{1}{\pi}\int_{-\pi}^{\pi}F(y)\mathrm{d}y=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}\mathrm{d}y+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}\mathrm{d}y+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\mathrm{d}y+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}\mathrm{d}t\\ \alpha_0 &= \frac{5}{2}+\frac{3(\pi-\frac{\pi}{2})}{\pi} \end{split}$$
\end{document}


Compiling using aligned enviroment you get the same result.

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{aligned} \alpha_0 &= \frac{1}{\pi}\int_{-\pi}^{\pi}F(y)dy=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}dy+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}dy+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}dy+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}dt\\ \alpha_0 &= \frac{5}{2}+\frac{3(\pi-\frac{\pi}{2})}{\pi} \end{aligned}
\end{document}