Skip to main content
deleted 294 characters in body
Source Link
rm -rf
  • 89.3k
  • 21
  • 297
  • 479
(-1)^(1/4) // N
0.707107 + 0.707107 I
(* Out[1]= 0.707107 + 0.707107 I *)

(-1)^(3/4) // N
(* Out[2]= -0.707107 + 0.707107 I *)
-0.707107 + 0.707107 I
Simplify[Sign@Denominator[finalnew], 
  Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega]ω > 0, d > 0}]
Sign[(ka^4 \[Omega]^2 + d^2 (kd^2 + \[Omega]^2)^2 - 
     4 d ka^2 \[Omega] (kd^2 - kd \[Omega] + \[Omega]^2)) 
   Cos[ Sqrt[2] L Sqrt[\[Omega]/d]] - (ka^4 \[Omega]^2 + 
     d^2 (kd^2 + \[Omega]^2)^2 + 
     4 d ka^2 \[Omega] (kd^2 + kd \[Omega] + \[Omega]^2)) 
    Cosh[Sqrt[2] L Sqrt[\[Omega]/d]] - 
  2 Sqrt[2] ka ((d^(3/2) (kd - \[Omega]) \[Omega]^(5/2) - 
        kd^2 (d \[Omega])^(3/2) + kd^3 Sqrt[d^3 \[Omega]] - 
        ka^2 kd Sqrt[d \[Omega]^3] + ka^2 Sqrt[d \[Omega]^5]) 
       Sin[Sqrt[2] L Sqrt[\[Omega]/d]] + (kd^2 (d \[Omega])^(3/2) + 
        kd^3 Sqrt[d^3 \[Omega]] + ka^2 kd Sqrt[d \[Omega]^3] + 
        ka^2 Sqrt[d \[Omega]^5] + 
        d^(3/2) \[Omega]^(5/2) (kd + \[Omega])) 
       Sinh[ Sqrt[2] L Sqrt[\[Omega]/d]])]
Simplify[Im@Denominator[finalnew],
(*
Out[3]= Sign[(ka^4 ω^2 + d^2 (kd^2 + ω^2)^2 - 4 d ka^2 ω (kd^2 - kd ω + ω^2)) 
    Cos[ Sqrt[2] L Sqrt[ω/d]] - (ka^4 ω^2 + d^2 (kd^2 + ω^2)^2 + 4 d ka^2 ω (kd^2 + kd ω + ω^2)) 
    Cosh[Sqrt[2] L Sqrt[ω/d]] - 2 Sqrt[2] ka ((d^(3/2) (kd - ω) ω^(5/2) - 
        kd^2 (d ω)^(3/2) + kd^3 Sqrt[d^3 ω] - ka^2 kd Sqrt[d ω^3] + ka^2 Sqrt[d ω^5]) 
    Sin[Sqrt[2] L Sqrt[ω/d]] + (kd^2 (d ω)^(3/2) + kd^3 Sqrt[d^3 ω] + ka^2 kd Sqrt[d ω^3] + 
        ka^2 Sqrt[d ω^5] + d^(3/2) ω^(5/2) (kd + ω)) 
    Sinh[ Sqrt[2] L Sqrt[ω/d]])
]
*)

Simplify[Im@Denominator[finalnew], Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega]ω > 0, d > 0, u > 0}]
(* Out[4]= 0 *)
0
Simplify[Im@Numerator[finalnew], 
 Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega]ω > 0, d > 0, u > 0}]
Expand@Im@Numerator[finalnew] /. {ka -> 1, kd -> 1, 
  L -> 1, \[Omega]ω -> 1, d -> 1, u -> 1}
6 Im[(-24 - 168 I) Cos[(-1)^(1/4)] - (24 - 168 I) Cosh[(-1)^(

(*
Out[5]= 6 Im[(-24 - 168 I) Cos[(-1)^(1/4)] - (24 - 168 I) Cosh[(-1)^(1/4)] - 
    (78 - 102 I) (-1)^(1/4)
  Sin[(-1)^(1/4)] + (42 + 24 I) (-1)^(3/4)
  Sin[(-1)^(1/4)] +
    (108 + 144 I) (-1)^(1/4) Sinh[(-1)^(1/4)] + 
  6 (-1)^(3/4) Sinh[(-1)^(3/4)]]
*)
FullSimplify@ Im[Numerator[finalnew] /.
  {ka -> 1, kd -> 1, L -> 1, \[Omega]ω -> 1,  d -> 1, u -> 1}]  
(* result is zero *)
FullSimplify[Im[Numerator[finalnew]], 
  Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega]ω > 0, d > 0, u > 0}]
(-1)^(1/4) // N
0.707107 + 0.707107 I
(-1)^(3/4) // N
-0.707107 + 0.707107 I
Simplify[Sign@Denominator[finalnew], 
  Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega] > 0, d > 0}]
Sign[(ka^4 \[Omega]^2 + d^2 (kd^2 + \[Omega]^2)^2 - 
     4 d ka^2 \[Omega] (kd^2 - kd \[Omega] + \[Omega]^2)) 
   Cos[ Sqrt[2] L Sqrt[\[Omega]/d]] - (ka^4 \[Omega]^2 + 
     d^2 (kd^2 + \[Omega]^2)^2 + 
     4 d ka^2 \[Omega] (kd^2 + kd \[Omega] + \[Omega]^2)) 
    Cosh[Sqrt[2] L Sqrt[\[Omega]/d]] - 
  2 Sqrt[2] ka ((d^(3/2) (kd - \[Omega]) \[Omega]^(5/2) - 
        kd^2 (d \[Omega])^(3/2) + kd^3 Sqrt[d^3 \[Omega]] - 
        ka^2 kd Sqrt[d \[Omega]^3] + ka^2 Sqrt[d \[Omega]^5]) 
       Sin[Sqrt[2] L Sqrt[\[Omega]/d]] + (kd^2 (d \[Omega])^(3/2) + 
        kd^3 Sqrt[d^3 \[Omega]] + ka^2 kd Sqrt[d \[Omega]^3] + 
        ka^2 Sqrt[d \[Omega]^5] + 
        d^(3/2) \[Omega]^(5/2) (kd + \[Omega])) 
       Sinh[ Sqrt[2] L Sqrt[\[Omega]/d]])]
Simplify[Im@Denominator[finalnew], 
 Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega] > 0, d > 0, u > 0}]
0
Simplify[Im@Numerator[finalnew], 
 Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega] > 0, d > 0, u > 0}]
Expand@Im@Numerator[finalnew] /. {ka -> 1, kd -> 1, 
  L -> 1, \[Omega] -> 1, d -> 1, u -> 1}
6 Im[(-24 - 168 I) Cos[(-1)^(1/4)] - (24 - 168 I) Cosh[(-1)^(
 1/4)] - (78 - 102 I) (-1)^(1/4)
  Sin[(-1)^(1/4)] + (42 + 24 I) (-1)^(3/4)
  Sin[(-1)^(1/4)] + (108 + 144 I) (-1)^(1/4) Sinh[(-1)^(1/4)] + 
  6 (-1)^(3/4) Sinh[(-1)^(3/4)]]
FullSimplify@ Im[Numerator[finalnew] /.
  {ka -> 1, kd -> 1, L -> 1, \[Omega] -> 1,  d -> 1, u -> 1}] (* result is zero *)
FullSimplify[Im[Numerator[finalnew]], 
  Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega] > 0, d > 0, u > 0}]
(-1)^(1/4) // N
(* Out[1]= 0.707107 + 0.707107 I *)

(-1)^(3/4) // N
(* Out[2]= -0.707107 + 0.707107 I *)
Simplify[Sign@Denominator[finalnew], 
  Assumptions -> {ka > 0, kd > 0, L > 0, ω > 0, d > 0}]

(*
Out[3]= Sign[(ka^4 ω^2 + d^2 (kd^2 + ω^2)^2 - 4 d ka^2 ω (kd^2 - kd ω + ω^2)) 
    Cos[ Sqrt[2] L Sqrt[ω/d]] - (ka^4 ω^2 + d^2 (kd^2 + ω^2)^2 + 4 d ka^2 ω (kd^2 + kd ω + ω^2)) 
    Cosh[Sqrt[2] L Sqrt[ω/d]] - 2 Sqrt[2] ka ((d^(3/2) (kd - ω) ω^(5/2) - 
        kd^2 (d ω)^(3/2) + kd^3 Sqrt[d^3 ω] - ka^2 kd Sqrt[d ω^3] + ka^2 Sqrt[d ω^5]) 
    Sin[Sqrt[2] L Sqrt[ω/d]] + (kd^2 (d ω)^(3/2) + kd^3 Sqrt[d^3 ω] + ka^2 kd Sqrt[d ω^3] + 
        ka^2 Sqrt[d ω^5] + d^(3/2) ω^(5/2) (kd + ω)) 
    Sinh[ Sqrt[2] L Sqrt[ω/d]])
]
*)

Simplify[Im@Denominator[finalnew], Assumptions -> {ka > 0, kd > 0, L > 0, ω > 0, d > 0, u > 0}]
(* Out[4]= 0 *)
Simplify[Im@Numerator[finalnew], 
 Assumptions -> {ka > 0, kd > 0, L > 0, ω > 0, d > 0, u > 0}]
Expand@Im@Numerator[finalnew] /. {ka -> 1, kd -> 1, L -> 1, ω -> 1, d -> 1, u -> 1}

(*
Out[5]= 6 Im[(-24 - 168 I) Cos[(-1)^(1/4)] - (24 - 168 I) Cosh[(-1)^(1/4)] - 
    (78 - 102 I) (-1)^(1/4) Sin[(-1)^(1/4)] + (42 + 24 I) (-1)^(3/4) Sin[(-1)^(1/4)] +
    (108 + 144 I) (-1)^(1/4) Sinh[(-1)^(1/4)] + 6 (-1)^(3/4) Sinh[(-1)^(3/4)]]
*)
FullSimplify@ Im[Numerator[finalnew] /. {ka -> 1, kd -> 1, L -> 1, ω -> 1,  d -> 1, u -> 1}]  
(* result is zero *)
FullSimplify[Im[Numerator[finalnew]], Assumptions -> {ka > 0, kd > 0, L > 0, ω > 0, d > 0, u > 0}]
added 771 characters in body
Source Link
Verbeia
  • 34.5k
  • 10
  • 110
  • 225

does not simplify to zero. For example:

Expand@Im@Numerator[finalnew] /. {ka -> 1, kd -> 1, 
  L -> 1, \[Omega] -> 1, d -> 1, u -> 1}
6 Im[(-24 - 168 I) Cos[(-1)^(1/4)] - (24 - 168 I) Cosh[(-1)^(
 1/4)] - (78 - 102 I) (-1)^(1/4)
 Sin[(-1)^(1/4)] + (42 + 24 I) (-1)^(3/4)
 Sin[(-1)^(1/4)] + (108 + 144 I) (-1)^(1/4) Sinh[(-1)^(1/4)] + 
  6 (-1)^(3/4) Sinh[(-1)^(3/4)]]

You can confirm the numerator is also real for specific values of the parameters:

FullSimplify@ Im[Numerator[finalnew] /.
  {ka -> 1, kd -> 1, L -> 1, \[Omega] -> 1,  d -> 1, u -> 1}] (* result is zero *)

But this takes an inordinate amount of time and the result is a long complex expression.

FullSimplify[Im[Numerator[finalnew]], 
  Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega] > 0, d > 0, u > 0}]

does not simplify to zero.

does not simplify to zero. For example:

Expand@Im@Numerator[finalnew] /. {ka -> 1, kd -> 1, 
  L -> 1, \[Omega] -> 1, d -> 1, u -> 1}
6 Im[(-24 - 168 I) Cos[(-1)^(1/4)] - (24 - 168 I) Cosh[(-1)^(
 1/4)] - (78 - 102 I) (-1)^(1/4)
 Sin[(-1)^(1/4)] + (42 + 24 I) (-1)^(3/4)
 Sin[(-1)^(1/4)] + (108 + 144 I) (-1)^(1/4) Sinh[(-1)^(1/4)] + 
  6 (-1)^(3/4) Sinh[(-1)^(3/4)]]

You can confirm the numerator is also real for specific values of the parameters:

FullSimplify@ Im[Numerator[finalnew] /.
  {ka -> 1, kd -> 1, L -> 1, \[Omega] -> 1,  d -> 1, u -> 1}] (* result is zero *)

But this takes an inordinate amount of time and the result is a long complex expression.

FullSimplify[Im[Numerator[finalnew]], 
  Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega] > 0, d > 0, u > 0}]
Source Link
Verbeia
  • 34.5k
  • 10
  • 110
  • 225

I don't know why you would expect Mathematica to understand that this is a real expression when you have I, (-1)^(1/4) and (-1)^(3/4) at various places in the expression.

(-1)^(1/4) // N
0.707107 + 0.707107 I
(-1)^(3/4) // N
-0.707107 + 0.707107 I

In this particular instance, the denominator is pretty obviously real.

Simplify[Sign@Denominator[finalnew], 
  Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega] > 0, d > 0}]
Sign[(ka^4 \[Omega]^2 + d^2 (kd^2 + \[Omega]^2)^2 - 
     4 d ka^2 \[Omega] (kd^2 - kd \[Omega] + \[Omega]^2)) 
   Cos[ Sqrt[2] L Sqrt[\[Omega]/d]] - (ka^4 \[Omega]^2 + 
     d^2 (kd^2 + \[Omega]^2)^2 + 
     4 d ka^2 \[Omega] (kd^2 + kd \[Omega] + \[Omega]^2)) 
    Cosh[Sqrt[2] L Sqrt[\[Omega]/d]] - 
  2 Sqrt[2] ka ((d^(3/2) (kd - \[Omega]) \[Omega]^(5/2) - 
        kd^2 (d \[Omega])^(3/2) + kd^3 Sqrt[d^3 \[Omega]] - 
        ka^2 kd Sqrt[d \[Omega]^3] + ka^2 Sqrt[d \[Omega]^5]) 
       Sin[Sqrt[2] L Sqrt[\[Omega]/d]] + (kd^2 (d \[Omega])^(3/2) + 
        kd^3 Sqrt[d^3 \[Omega]] + ka^2 kd Sqrt[d \[Omega]^3] + 
        ka^2 Sqrt[d \[Omega]^5] + 
        d^(3/2) \[Omega]^(5/2) (kd + \[Omega])) 
       Sinh[ Sqrt[2] L Sqrt[\[Omega]/d]])]
Simplify[Im@Denominator[finalnew], 
 Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega] > 0, d > 0, u > 0}]
0

So concentrate on refining the numerator. The equivalent

Simplify[Im@Numerator[finalnew], 
 Assumptions -> {ka > 0, kd > 0, L > 0, \[Omega] > 0, d > 0, u > 0}]

does not simplify to zero.

As for general strategies, FullSimplify with as many variables in the Assumptions option is a good bet in most cases, as is separately simplifying numerators and denominators. I don't know if there are best-practice strategies, though. I would expect it would depend on the kind of expression, for example, whether it is a polynomial or contains trigonometric expressions.