add tag
Anonymous 14035
I have a macro for solving quadratic equations (I use *polexpr* package). Is there a way to simplify this macro if possible.

```
\def\SolveIQuadraticEq#1#2#3{%
  \poldef #1;%
  \def\next##1(##2)##3\relax{%
    \xintdefvar a=coeff(##1,2);\xintdefvar b=coeff(##1,1);\xintdefvar c=coeff(##1,0);\xintdefvar DELTA=b^2-4*a*c;%
    \expandafter\def\csname #2\endcsname{\myfrac{-b/2/a}+\FracSquareRoot{DELTA/4/a^2}}%
    \expandafter\def\csname #3\endcsname{\myfrac{-b/2/a}-\FracSquareRoot{DELTA/4/a^2}}%
  }\next #1\relax
}
```
And then, I use 

```
\SolveIQuadraticEq{f(x) := 3x^2 - 4x - 5}{xone}{xtwo}
```
To present two solutions, I use

```
\[ x_1 = \xone, \quad x_2 = \xtwo. \]

```
I got 

![image.png](/image?hash=827ffe69e09b4df5e583be95397b0de9d7375dfe3ed778c719ec12db72978e97)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.