这行代码之后出现了问题,但我不知道是什么

这行代码之后出现了问题,但我不知道是什么
\[ \begin{split} 
&( \frac{21! \cdot 2^3}{3! 18! \cdot 4^{18}} + 
\frac{21! \cdot 2^2}{2! 2! 17! \cdot 5^2 \cdot 4^{17}} \\ 
& + \frac{21! \cdot 2}{4! 16! \cdot 5^4 \cdot 4^{16}} + 
frac{21!}{6! 15! \cdot 5^6 \cdot 4^{15}} ) x^{36} \\
&= ( \frac{38138681}{67108864000000} ) x^{36}
\end{split} \]

有什么问题吗?日志没有告诉我任何有用的信息。以下是完整文件:

\documentclass[letterpaper, 12pt, titlepage]{article}
\pagestyle{myheadings} \markright{Fakaff \hfill MATH2P81 \hfill}
\usepackage{amsmath}

\begin{document}

\title{MATH 2P81 \\ Assignment \#1}
\date{\today}
\author{Fakaff \\ \texttt{4847653}}
\maketitle

\begin{enumerate}

\item All terms of the expansion will be of the form $ \binom{21}{a, b, c} 2^a x^b (x^2)^c  $. To 
find the coefficient of $ x^{36} $, we must first find all sets $ \{a, b, c\} $ such that 
$ a + b + c = 21 $ and $ a + b + 2c = 36 $:

$\{3, 0, 18\} $

$ \{2, 2, 17\} $

$ \{1, 4, 16 \} $

$ \{0, 6, 15 \} $

Plugging these numbers into our formula, we get:

\[ \begin{split} 
&( \frac{21! \cdot 2^3}{3! 18! \cdot 4^{18}} + \frac{21! \cdot 2^2}{2! 2! 17! \cdot 5^2 \cdot 4^{17}} \\ 
& + \frac{21! \cdot 2}{4! 16! \cdot 5^4 \cdot 4^{16}} + frac{21!}{6! 15! \cdot 5^6 \cdot 4^{15}} ) x^{36} \\
&= ( \frac{38138681}{67108864000000} ) x^{36}
\end{split} \]

Checking in maple by using the \texttt{expand( (2 - (x/5) + (x^2/4 )^21 )} command confirms this result. 


\end{enumerate}
\end{document}

答案1

您缺少$以下单词的 s:

Checking in maple by using the \texttt{expand$(2 - (x/5) + (x^2/4 )^21)$} command confirms this result. 

并且您还缺少\a 中的a \frac。完整的更正版本如下(我还添加了\left(,\right)括号,因为它们将根据封闭文本的垂直高度调整大小。left.\right.是必需的,因为我们需要\left在同一行上与“left”匹配。

\documentclass[letterpaper, 12pt, titlepage]{article}
\pagestyle{myheadings} \markright{Fakaff \hfill MATH2P81 \hfill}
\usepackage{amsmath}

\begin{document}

\title{MATH 2P81 \\ Assignment \#1}
\date{\today}
\author{Fakaff \\ \texttt{4847653}}
\maketitle

\begin{enumerate}

\item All terms of the expansion will be of the form $ \binom{21}{a, b, c} 2^a x^b (x^2)^c  $. To 
find the coefficient of $ x^{36} $, we must first find all sets $ \{a, b, c\} $ such that 
$ a + b + c = 21 $ and $ a + b + 2c = 36 $:

$\{3, 0, 18\} $

$ \{2, 2, 17\} $

$ \{1, 4, 16 \} $

$ \{0, 6, 15 \} $

Plugging these numbers into our formula, we get:

\[ \begin{split} 
&\left( \frac{21! \cdot 2^3}{3! 18! \cdot 4^{18}} + \frac{21! \cdot 2^2}{2! 2! 17! \cdot 5^2 \cdot 4^{17}} \right.\\ 
& \left. + \frac{21! \cdot 2}{4! 16! \cdot 5^4 \cdot 4^{16}} + \frac{21!}{6! 15! \cdot 5^6 \cdot 4^{15}} \right) x^{36} \\
&= \left( \frac{38138681}{67108864000000} \right) x^{36}
\end{split} \]

Checking in maple by using the \texttt{expand$(2 - (x/5) + (x^2/4 )^21)$} command confirms this result. 
\end{enumerate}
\end{document}

如果您不想格式化内的文本\expand,而是想要符号^,则可以使用:

Checking in maple by using the \texttt{expand(2 - (x/5) + (x\textasciicircum 2/4 )\textasciicircum 21)} command confirms this result. 

答案2

问题是里面的文本\texttt{}包含数学符号,因此您需要$字符,正如所指出的那样@Peter Grill

或者,你可以将有问题的行替换为:

Checking in maple by using the $\mathtt{expand( (2 - (x/5) + (x^2/4 )^21 )}$ command confirms this result.

结果整个表达式被排版成“打字机”字体,我想这正是你想要的。

相关内容