将分子和分母较长的等式拆分为多行

将分子和分母较长的等式拆分为多行

我尝试用不同的方法将一个长等式(分子和分母)拆分成多行(如何将方程式拆分为两行(或更多行)如何在 Latex 中包装长公式),但它们不起作用 (latex 给出错误)。我该如何解决这个问题?

表达式(由 Mathematica 生成)如下(分割应发生在存在指数项的地方):

y(t) = h(t) = \frac{e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}-\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} k_1 -e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}+\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} k_1-e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}-\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} k_2+e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}+\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} k_2-e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}-\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} k_{12}+e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}+\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} k_{12}+e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}-\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} k_{21}-e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}+\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} k_{21}+e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}-\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1
   k_2+k_{21} k_2+k_1 k_{12}\right)}+e^{t
   \left(-\frac{k_1}{2}-\frac{k_2}{2}-\frac{k_{12}}{2}-\frac{k_{21}}{2}+\frac{1}{2
   } \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)}\right)} \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1
   k_2+k_{21} k_2+k_1 k_{12}\right)}}{2
   \sqrt{\left(k_1+k_2+k_{12}+k_{21}\right){}^2-4 \left(k_1 k_2+k_{21} k_2+k_1
   k_{12}\right)} V_1} 

感谢您的帮助。

答案1

我希望我算得没错:)

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
   A&:=\sqrt{(k_1+k_2+k_{12}+k_{21})^2-4(k_1k_2+k_{21}k_2+k_1k_{12})}\\
   B&:=k_1+k_2+k_{12}\\
   C&:=k_1-k_2-k_{12}\\
a(t)&:=\exp\left(-\frac{A+B}{2}t\right)\\
b(t)&:=\exp\left(\frac{A-B}{2}t\right)\\
y(t)&=h(t)=\frac{a(t)(A+C+k_{21})+b(t)(A-C)-k_{21}}{2AV_1} 
\end{align*}
\end{document}

在此处输入图片描述

相关内容