I am trying to add a horizontal line between aligned equations.
I have tried using \rule
command, but then the problem is that it itself takes that command as an equation, since I am using \\
before and after this command, otherwise it is not aligning the equations correctly. With these, it uses unnecessary spaces above and below the horizontal rule. I want the output to be such that the equations are aligned as expected from the align*
environment, with a horizontal line 'externally inserted' between two equations.
\begin{align*}
y_2\times (y_2''+Py_2'+Qy_2) &=0\\
-y_1\times (y_1''+Py_1'+Qy_1) &=0\\
\rule{4.7cm}{1pt}&\rule{1cm}{1pt}\\
y_1y_2''-y_1''y_2+P(y_1y_2'-y_1'y_2) &= 0\\
\end{align*}
The above is what I wrote, but it shows too much space above and below the horizontal rule. Even if I shift this rule 3mm upwards, the space below the rule increases and the problem remains same. Is there any way to add a horizontal rule whose space below and above can also be controlled?
Please help.
\documentclass
and ending with\end{document}
. The following may help:\[ \begin{aligned} y_2\times (y_2''+Py_2'+Qy_2) &=0\\ -y_1\times (y_1''+Py_1'+Qy_1) &=0\\ \hline y_1y_2''-y_1''y_2+P(y_1y_2'-y_1'y_2) &= 0\\ \end{aligned} \]