0
$\begingroup$

I want to use Mathematica to refine some expressions for me. Ultimately I want to find some set of matrices that suffice to certain conditions. In my calculations I'm adding a diagonal matrix $A$ to another matrix $B$ and I impose some conditions on the determinant, e.g. that a certain coefficient is zero. I calculated by hand that my conditions imply that some elements of my matrix are equal. E.g. I would get for a $3 \times 3$ matrix $B_{12}B_{21} = B_{13}B_{31}$. I can let Mathematica find this condition but I then want Mathematica to use all this information to give me some expression for the matrix $B$. But I can't really get this to work using the Assumptions command.

My problem is as such, if for we have some identity that that a coefficient is zero and this coefficient is $x^3 - 4 x^2 + x = 0$ (but the conditions can become way more complex) I then :

Assuming[{x^3 - 4 x^2 + x == 0, Element[x, Reals]}, 
{Simplify[x^7 - 4 x^3 + x^2 + 1], Simplify[x^3 - 4 x^2 + x], Simplify[x*(x^3 - 4 x^2 + x)]}] 

I have some identity $x^3 - 4 x^2 + x = 0$, but Mathematica does not use this information to rewrite $x^7 - 4 x^3 + x^2 + 1$ when I use Simplify (or FullSimplify or Refine). While clearly we can multiply the identity with $x^4$ to get rid of the $x^7$ and then for the lower terms to even get to a second degree polynomial. However it does refine $x (x^3 - 4 x^2 + x)$ so it maybe does try.

Does anyone of you know why Simplify can't reduce the expression, or how I should code the program otherwise? I'm not interested in the answer for this specific polynomial. I get that I maybe can use modulo calculations in Mathematica to solve it.

$\endgroup$
  • $\begingroup$ Check ref guide page for PolynomialReduce as it might do what you have in mind. In one example:In[75]:= PolynomialReduce[x^7 - 4 x^3 + x^2 + 1, x^3 - 4 x^2 + x, x][[2]] Out[75]= 1 - 205 x + 765 x^2 $\endgroup$ – Daniel Lichtblau Dec 9 '17 at 18:33
  • $\begingroup$ Why can't Simplify do that? And it not really answers what I want, because this only solves it for polynomials. I want to give identities to Mathematica (such as $det(B)=0$) which Mathematica then uses to rewrite expressions. But when I use assumptions with simplify it doesn't go as far as I want. Thanks for PolynomialReduce though, but I think I can only use that in this specific case and not for e.g. my determinant condition. $\endgroup$ – user1792605 Dec 9 '17 at 18:53
  • $\begingroup$ Although for a Determinant I could define all elements as variables and consider it a a polynomial and then reduce. Do you think that would work, as in work with $n^2$ variables for a $n \times n$ matrix. Can Mathematica handle that? $\endgroup$ – user1792605 Dec 9 '17 at 18:59
  • $\begingroup$ Could try it. Depends on the dimension as to how well it simplifies things. $\endgroup$ – Daniel Lichtblau Dec 10 '17 at 16:18

Your Answer

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

Browse other questions tagged or ask your own question.