enter image description here 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

  • 3
    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.
    – Sandy G
    Commented Nov 3, 2017 at 3:25
  • 1
    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

1 Answer 1


(This answer addresses only the question about how to typeset some linear equations.)

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.

enter image description here

\usepackage{array}     % for "\newcolumntype" macro

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

& (\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 \\
& (\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 \\
& (-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)\\
  • 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .