1

I've been trying to make a system of linear equations in LaTeX for a while, I couldn't even find results on the internet. Another thing to note is everything I've tried was based on the \systeme command provided by the systeme package that everyone seems to use, I don't know if there's a better alternative to that I could use but if there is, I'd be very happy to know. I'll use this equation as an example:

x-y=1
x^{2}+y^{2}=41

By solving this equation I get to

\systeme{x-y=1, x^{2}+y^{2}=41} 
\systeme{x=y+1,x^{2}+y^{2}=41} 
\systeme{x=y+1,(y+1)^{2}+y^{2}} 

All the codes until \systeme{x=y+1,(y+1)^{2}+y^{2}} work fine, but that one really doesn't work, I've tried various different things but it always displays this error message in french

! Package systeme Error: l'inconnue "y_{-1}" a deja ete trouvee dans l'equation
 !.
<argument> ... deja ete trouvee dans l'equation !}
                                                  \fi \ifSYS_sortvariable \S...
l.78 \systeme{x=y+1,(y+1)^{2}+y^{2}}

I don't know french but by putting it in google translate I get:

! Package system Error: the unknown "y _ {- 1}" has already been found in the equation
 !
<argument> ... already found in the equation!}
                                                  \ fi \ ifSYS_sortvariable \ S ...
l.78 \ system {x = y + 1, (y + 1) ^ {2} + y ^ {2}}

I think the problem is that y appeared twice in the equation, but that is supposed to happen, is there anything I could do besides putting y_{1} and y_{2} in the entire equation? Thanks in advance

2
  • 3
    \systeme is for linear systems
    – egreg
    Jun 25 '20 at 14:11
  • Oh... What should I do/use then? Thanks for the information though Jun 25 '20 at 14:21
1

I see no sensible way to align variables in nonlinear systems. Maybe the first system might have x and y aligned with each other, but what about the other two?

\documentclass{article}
\usepackage{amsmath,array}

\newenvironment{lsystem}% left aligned system
 {\left\lbrace\renewcommand{\arraystretch}{1.2}\begin{array}{@{}l@{}}}
 {\end{array}\right.}

\begin{document}

\[
\begin{lsystem}
x-y=1 \\
x^2+y^2=41
\end{lsystem}
\quad
\begin{lsystem}
x=y+1 \\
x^2+y^2=41
\end{lsystem}
\quad
\begin{lsystem}
x=y+1 \\
(y+1)^2+y^2=41
\end{lsystem}
\]

\end{document}

enter image description here

Why not cases? Because it would add unwanted space at its right side.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.