三次方程分步解法的格式改进

三次方程分步解法的格式改进

\amsmath和的范围内\tasks,提供了寻找三次方程的三个根的逐步解决过程。

请求您帮助解决以下 2 个问题:

  1. 将每个问题中两个立方根之间的水平空间减少到约 2-3 毫米:

在此处输入图片描述

  1. 插入标注(左列和右列)以确定产生根的第一个因子。此外,加粗黄色突出显示的因素

在此处输入图片描述

谢谢!mwe 如下

\documentclass[12pt]{exam}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{framed} %box para
\usepackage{multicol}
\usepackage{tasks}
\usepackage{xcolor}
\usepackage[margin=0.5in]{geometry}

%\usepackage{bm}%bold equation
\setlength{\parindent}{0pt} % removes paragraph indentation

\pagestyle{head}
\header{Algegra II: Assignment: 10-C Solving Polynomial Equations}
       {}
       {Due 03/12/2023} 

\newcommand{\pagetop}{%
  %\makebox[\textwidth]%{Name:\enspace\hrulefill}\par
  \vspace{4mm}
  \fbox{\fbox{\parbox{\dimexpr\textwidth-4\fboxsep-4\fboxrule}{
    \textbf {Solve each polynomial equation by factoring. Find all real and/or  imaginary/complex roots. Simplify answers.}
    %\par
    %\bigskip

  }}}\par
  \vspace{0.5mm}
}
\setlength{\jot}{1em}
%define highlighting

\newcommand{\hll}[1]{\colorbox{yellow}{$\displaystyle #1$}}

\begin{document}
\pagetop

\settasks{
    after-item-skip=3em,    after-skip=2cm,
    label-width=2em,
    item-indent=3em,
    label=(\arabic*),
    column-sep=2em
}
\begin{tasks}(2)
%Prob #1
\task \(\begin{aligned}[t]
&x^3-216=0 \\
& \hspace{2em}\begin{aligned}[t]
&\sqrt[3]{x^3} =3
&\sqrt[3]{216} =6\\
&\hll {(x-6)}(x^2+6x+6^2)\\
&\hll{(x-6)}(x^2+6x+36)\\
&a = 1; b = 6; c = 36\\
&x=\frac{-(b)\pm\sqrt{(b^2)-4(a)(c)}}{2(a)}\\
&x=\frac{-(6)\pm\sqrt{(6^2)-4(1)(36)}}{2(1)}\\
&x=\frac{-6\pm\sqrt{-144}}{2}\\
&x=\frac{-(6)\pm\sqrt{(6^2)-4(1)(36)}}{2(1)}\\
&x=\frac{-6\pm\sqrt{-108}}{2}\\
&x=\frac{-6\pm 6i\sqrt{3}}{2}\\
&x=\frac{2(-3\pm 3i\sqrt{3})}{2}\\
&x=\-3\pm 3i\sqrt{3}&x=6\\
\end{aligned}
\end{aligned}\)
%Problem #2
\task \(\begin{aligned}[t]
&8x^3 +125 \\
& \hspace{2em}\begin{aligned}[t]
&\sqrt[3]{8x^3} =2x
&\sqrt[3]{125} =5\\
&\hll{(2x+5)}(4x^2-10x+5^2)\\
&\hll{(2x+5)}(4x^2-10x+25)\\
&a = 4; b = -10; c = 25\\
&x=\frac{-(b)\pm\sqrt{(b^2)-4(a)(c)}}{2(a)}\\
&x=\frac{-(-10)\pm\sqrt{(-10^2)-4(4)(25)}}{2(4)}\\
&x=\frac{10\pm\sqrt{-300}}{8}\\
&x=\frac{10\pm 10i\sqrt{3}}{8}\\
&x=\frac{2(5\pm 5i\sqrt{3})}{8}\\
&x=\frac{5\pm 5i\sqrt{3})}{4}&x=-\frac{-5}{2}\\
\end{aligned}
\end{aligned}\)
%Problem #3

\end{tasks}
\end{document}```

答案1

让我们分部分来看:

  1. 对于简单的间距,我们可以使用命令\quad\qquad在间距中保持一定的标准化,在您的情况下,使用\qquad是最好的选择。

  2. 为了创建带有警告框的黄色框,我创建了一个新命令,该命令分配了两个条目:\callout{#1}{#2}。第一个条目#1是方程的项,将以黄色突出显示,而第二个条目#2是方程的其余部分,不会突出显示。需要评论的重要一点是需要一条指令,在本例中是[2.2em]在换行符之前。通过举例说明,它将变得更加清晰。

套餐

\documentclass[12pt]{exam}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{framed} % box para
\usepackage{multicol}
\usepackage{tasks}
\usepackage{xcolor}
\usepackage[margin=0.5in]{geometry}
\usepackage{tikz}
\usetikzlibrary{shapes.callouts} % To create the call out boxes

新的命令

\newcommand*{\callout}[2]{\hspace{-5em}
\tikz[baseline=(X)] \node[shape = rectangle callout, 
    fill=white, 
    draw= black, 
    minimum width=4.5em,
    rounded corners,
    callout relative pointer={(+0.55,-0.45)}, 
    font = {\sffamily},
    ] (X) {${\scriptsize\begin{matrix}\textrm{1st root/} \\ \textrm{solution}\end{matrix}}$};%
\tikz[baseline=(X.base)] \node[rectangle, fill=yellow, inner sep=1mm] (Y) at ([yshift = -2.2em]X) {$#1$};%
\tikz[baseline=(X.base)] \node[] at (Y.east) {$#2$};%
 }

新的命令没有垂直间距指令

 \begin{tasks}(2)
 % Problem 1:
 \task \(
 \begin{aligned}[t]
    & x^3-216 = 0 \\
    & \hspace{2em}
    \begin{aligned}[t]
        & \sqrt[3]{x^3} = 3 \qquad \sqrt[3]{216} = 6 \\
        & \hll{(x-6)}(x^2+6x+6^2) \\%[-2.2em]
        % Do not space here:        ^
        & \callout{(x-6)}{(x^2+6x+36)} \\
    \end{aligned}
 \end{aligned}
 \)
 \end{tasks}

使用此代码,输出有以下空格: 在此处输入图片描述

垂直间距指令中的新命令

但是,如果我们包括这些指令:

 \begin{tasks}(2)
 % Problem 1:
 \task \(
 \begin{aligned}[t]
    & x^3-216 = 0 \\
    & \hspace{2em}
    \begin{aligned}[t]
        & \sqrt[3]{x^3} = 3 \qquad \sqrt[3]{216} = 6 \\
        & \hll{(x-6)}(x^2+6x+6^2) \\[-2.2em]
        % Do not space here:        ^
        & \callout{(x-6)}{(x^2+6x+36)} \\
    \end{aligned}
 \end{aligned}
 \)
 \end{tasks}

我们得到这个: 在此处输入图片描述

关于这个新命令的一些评论

我添加了一条注释,不要将双杠\\和指令隔开[-2.2em],这是因为这些指令不适用于此空间。

完整代码

最后,我将发布所有代码和相应的输出:

\documentclass[12pt]{exam}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{framed} %box para
\usepackage{multicol}
\usepackage{tasks}
\usepackage{xcolor}
\usepackage[margin=0.5in]{geometry}
\usepackage{tikz}
\usetikzlibrary{shapes.callouts}

\newcommand*{\callout}[2]{\hspace{-5em}
    \tikz[baseline=(X)] \node[shape = rectangle callout, 
        fill=white, 
        draw= black, 
        minimum width=4.5em,
        rounded corners,
        callout relative pointer={(+0.55,-0.45)}, 
        font = {\sffamily},
        ] (X) {${\scriptsize\begin{matrix}\textrm{1st root/} \\ \textrm{solution}\end{matrix}}$};%
    \tikz[baseline=(X.base)] \node[rectangle, fill=yellow, inner sep=1mm] (Y) at ([yshift = -2.2em]X) {$#1$};%
    \tikz[baseline=(X.base)] \node[] at (Y.east) {$#2$};%
}

%\usepackage{bm}%bold equation
\setlength{\parindent}{0pt} % removes paragraph indentation

\pagestyle{head}
\header{Algebra II: Assignment: 10-C Solving Polynomial Equations}
       {}
       {Due 03/12/2023} 

\newcommand{\pagetop}{%
  %\makebox[\textwidth]%{Name:\enspace\hrulefill}\par
  \vspace{4mm}
  \fbox{\fbox{\parbox{\dimexpr\textwidth-4\fboxsep-4\fboxrule}{
    \textbf {Solve each polynomial equation by factoring. Find all real and/or  imaginary/complex roots. Simplify answers.}
    %\par
    %\bigskip

  }}}\par
  \vspace{0.5mm}
}
\setlength{\jot}{1em}
%define highlighting

\newcommand{\hll}[1]{\colorbox{yellow}{$\displaystyle #1$}}

\begin{document}
\pagetop

\settasks{
    after-item-skip=3em,    after-skip=2cm,
    label-width=2em,
    item-indent=3em,
    label=(\arabic*),
    column-sep=2em
}

\begin{tasks}(2)
    % Problem 1:
    \task \(
    \begin{aligned}[t]
        & x^3-216 = 0 \\
        & \hspace{2em}
        \begin{aligned}[t]
            & \sqrt[3]{x^3} = 3 \qquad \sqrt[3]{216} = 6 \\
            & \hll{(x-6)}(x^2+6x+6^2) \\[-2.2em]
            % Do not space here:        ^
            & \callout{(x-6)}{(x^2+6x+36)} \\
            & a = 1; b = 6; c = 36 \\
            & x = \frac{-(b)\pm\sqrt{(b^2)-4(a)(c)}}{2(a)} \\
            & x = \frac{-(6)\pm\sqrt{(6^2)-4(1)(36)}}{2(1)} \\
            & x = \frac{-6\pm\sqrt{-144}}{2} \\
            & x = \frac{-(6)\pm\sqrt{(6^2)-4(1)(36)}}{2(1)} \\
            & x = \frac{-6\pm\sqrt{-108}}{2} \\
            & x = \frac{-6\pm 6i\sqrt{3}}{2} \\
            & x = \frac{2(-3\pm 3i\sqrt{3})}{2} \\
            & x = \-3\pm 3i\sqrt{3} \qquad x=6 \\
        \end{aligned}
    \end{aligned}
    \)
    % Problem #2
    \task 
    \(\begin{aligned}[t]
        & 8x^3 +125 \\
        & \hspace{2em}
        \begin{aligned}[t]
            & \sqrt[3]{8x^3} = 2x \qquad \sqrt[3]{125} = 5 \\
            & \hll{(2x+5)}(4x^2-10x+5^2) \\[-2.2em]
            & \callout{(2x+5)}{(4x^2-10x+25)} \\
            & a = 4; b = -10; c = 25 \\
            & x = \frac{-(b)\pm\sqrt{(b^2)-4(a)(c)}}{2(a)} \\
            & x = \frac{-(-10)\pm\sqrt{(-10^2)-4(4)(25)}}{2(4)} \\
            & x = \frac{10\pm\sqrt{-300}}{8} \\
            & x = \frac{10\pm 10i\sqrt{3}}{8} \\
            & x = \frac{2(5\pm 5i\sqrt{3})}{8} \\
            & x = \frac{5\pm 5i\sqrt{3})}{4} \qquad x=-\frac{-5}{2} \\
        \end{aligned}
    \end{aligned}
    \)
    % Problem 3
\end{tasks}

\end{document}

![在此处输入图片描述

相关内容