# how to subtract algebraic equations using column method?

How to subtract the algebraic equations using column method? Also is any possibility to solve algebraic equations using latex? Help to produce result like this latex

• Welcome to TeX Stack Exchange. It is customary when asking a question to demonstrate a legitimate attempt at solving it yourself. You should include this attempt as a "Minimal Working Example" (MWE) that starts with \documentclass and ends with \end{document}. Your MWE should compile without errors even if it doesn't produce the exact result you desire. Then other users will be much more likely to help you toward a satisfactory solution. Commented Nov 3, 2017 at 3:25
• LaTeX and TeX are designed primarily for typesetting, including the typesetting of math material. To solve symbolic algebraic expressions (including equations), you should look into software such as Mathematica and Maple.
– Mico
Commented Nov 3, 2017 at 6:01

I suggest you employ an array environment. The following code illustrates most of the relevant techniques. You are obviously free to come up with more-descriptive labels than (A) and (B); if you wish, you can also omit them entirely. Same for the \cancel directives.

\documentclass{article}
\usepackage{array}     % for "\newcolumntype" macro
\newcolumntype{C}{>{{}}c<{{}}}
\newcolumntype{L}{>{\displaystyle}l}
\newcolumntype{R}{>{\displaystyle}r}
\renewcommand\arraystretch{1.5}

\usepackage{booktabs}  % for "\midrule" macro
\usepackage{cancel}    % for "\cancel" macro (optional)

\begin{document}
$\setlength\arraycolsep{0pt} \begin{array}{R@{\quad}RCRCL} (\mathrm{A}) & (\cancel{-28\lambda^3} +11\lambda^2 +\cancel{2\lambda} -1) a_2^2 & + & (4\lambda^2 +2) a_3 & = & B_1b_2+B_2b_1^2 \\ (\mathrm{B}) & (\cancel{-28\lambda^3} +19\lambda^2 +\cancel{2\lambda} +3) a_2^2 & - & (4\lambda^2+2) a_3 & = & B_1c_2+B_2c_1^2 \\ \cmidrule{2-6} (\mathrm{A})-(\mathrm{B}) & (-8\lambda^2-4)a_2^2 & + & (8\lambda^2 +4) a_3 & = & B_1(b_2-c_2)+B_2(b_1^2-c_1^2)\\ \end{array}$
\end{document}
• Thank you for your solution. I need one more help. When I try to draw a line down to the (A)- (B) row. I used \cline \hline also I used \cmidrule{2-6} but all these things aren't work correctly. Help me to complete that. Also I want to display the sign changes under the (B) row that shown in image which I post. Commented Nov 3, 2017 at 13:40
• @SubramaniFalthoozMsm - Please be more specific than "all these things aren't work correctly". Separately, if you use \cmidrule, you should under no circumstance be using \cline and \hline, unless you want to generate awful output. Please clarify what it is you're trying to achieve. Finally, the reason my answer doesn't feature a row with - and + symbols is that I couldn't parse your handwritten notes. What exactly is supposed to be going on?
– Mico
Commented Nov 3, 2017 at 14:31
• I need two things. 1. While subtracting algebraic expressions we have to change the sign. So that sign I need to display. 2. While we adding number at the end we draw 2 lines here only one line I need to draw one more line under the result Commented Nov 3, 2017 at 14:38
• @SubramaniFalthoozMsm - I'm afraid I don't understand what you wrote regarding item 1. For item 2, write \bottomrule to draw a line under the entire expression.
– Mico
Commented Nov 3, 2017 at 15:48