2
$\begingroup$

After I use Simplify on an expression I get$\dfrac{1}{2}\sqrt{-\dfrac{\sqrt{(-b^2+16|c|^2)(4|c|^2+b\Im(c))^2}}{4a(4|c|^2+b\Im(c)])}}$. This expression can clearly be simplified further by noticing that the square bracket term in the numerator cancels the other bracket term in the denominator so $\dfrac{1}{2}\sqrt{-\dfrac{\sqrt{(-b^2+16|c|^2)}}{4a}}$. This is clearly a much simpler form since it includes less terms, so my question is why does not mathematica do this?

Edit: here is my code

real[x_, y_] := -2 a x^3 - 2 a y^2 x + 2 Re[c] x + 2 Im[c] y + b/2 y;
imaginary[x_, y_] := -2 a x^2 y - 2 a y^3 + 2 Im[c] x - 2 Re[c] y - b/2 x;
sol = Solve[{real[x, y] == 0, imaginary[x, y] == 0},{x,y}];
FullSimplify[Sqrt[(x /. sol[[2, 1]])^2 + (y /. sol[[2, 2]])^2],
Assumptions -> {(a | b) ∈ Reals && c ∈ Complexes && (a | b | c) > 0}]
$\endgroup$
6
  • $\begingroup$ Your expectation is only true if you assume the expression to be ` Real>0 ` $\endgroup$ Feb 9, 2018 at 9:26
  • $\begingroup$ What do you mean by !=0? Is it not equal to zero? When I use the Simplify function I've included the assumption that $a,b,c>0$ $\endgroup$ Feb 9, 2018 at 9:29
  • $\begingroup$ != stands for not equal. $\endgroup$ Feb 9, 2018 at 9:31
  • $\begingroup$ Please give your mathematica code. What about bJ(c) ? Is this a function? $\endgroup$ Feb 9, 2018 at 9:34
  • $\begingroup$ Okey, but I have used included the assumption in the Simplify function that $a,b,c>0$ so the expression in the bracket must thus be $>0$ $\endgroup$ Feb 9, 2018 at 9:34

2 Answers 2

4
$\begingroup$

You have given contradictive assumptions. In Mma the condition that a variable, say, c, is positive (c>0) automatically means that it belongs to Reals. Thus, when you fix c ∈ Complexes && (a | b | c) > 0 you mislead Mma.

According to your initial expressions the parameters a and b are Reals and positive, while c is Complex, am I right? If yes, try this:

    expr = Simplify[Sqrt[(x /. sol[[2, 1]])^2 + (y /. sol[[2, 2]])^2], 
      Assumptions -> {a, b} > 0];

MapAt[PowerExpand, expr, {2, 1}]

(*  1/2 Sqrt[-((I Sqrt[b^2 - 16 Im[c]^2 - 16 Re[c]^2])/a)]  *)

Have fun!

Edit: To address your question:

{2,1} is a TreeCoordinate of the part of the whole expression that is under the outer square root. The Tree you can visualize by the function

TreeForm[expr]

yielding the following structure

enter image description here

Here the arrow indicates the element {2,1} that wee need. This can be made visible, if you hover the cursor over this element. It is this element that the PowerExpand function is convenient to be applied to.

$\endgroup$
2
  • $\begingroup$ Yes a,b are real and positive while c is complex. True, good that you pointed that out that assuming c>0 is misleading. What does exactly the {2,1} term in MapAt do? $\endgroup$ Feb 9, 2018 at 10:42
  • 1
    $\begingroup$ @Turbotanten Please have a look at the edit. $\endgroup$ Feb 9, 2018 at 10:51
1
$\begingroup$

The "bracket" you want to simplify is complex!

bracket = r Exp[I φ];(* stands for (4 c Conjugate[c] + b Im[c])*)

expr = Sqrt[bracket^2]/bracket ;
FullSimplify[ expr, {Element[{r, φ}, Reals], r > 0 }]   
(* E^(-I φ) Sqrt[E^(2 I φ)] *) 

Further simplification needs information about φ

$\endgroup$
2
  • $\begingroup$ What do you mean by the bracket I want to simplify is complex? There is no imaginary unit in my expression. $\endgroup$ Feb 9, 2018 at 10:02
  • $\begingroup$ @Turbotanten: The "bracket" is the expression (4 c Conjugate[c] + b Im[c]) which is complex! By the way your restrictions c>0 and c complex cannot be fullfilled both. $\endgroup$ Feb 9, 2018 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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