0
$\begingroup$

I have the following

Inactive[Log][Sqrt[
 E^(-0.96 t - 0.96 Conjugate[t])
   Conjugate[
   Cosh[(sqr t)/2] - (1.76 Sinh[(sqr t)/2])/sqr] (Cosh[(sqr t)/2] - (
    1.76 Sinh[(sqr t)/2])/sqr)]]

Removing inactivate, upon taking the derivative w.r.t t, I end up with

E^(0.96 t + 
    0.96 Conjugate[t]) (E^(-0.96 t - 0.96 Conjugate[t])
       Conjugate[
       Cosh[(sqr t)/2] - (1.76 Sinh[(sqr t)/2])/
        sqr] (-0.88 Cosh[(sqr t)/2] + 1/2 sqr Sinh[(sqr t)/2]) + 
     E^(-0.96 t - 0.96 Conjugate[t])
       Conjugate[
       Cosh[(sqr t)/2] - (1.76 Sinh[(sqr t)/2])/
        sqr] (Cosh[(sqr t)/2] - (1.76 Sinh[(sqr t)/2])/sqr) (-0.96 - 
        0.96 Derivative[1][Conjugate][t]) + 
     E^(-0.96 t - 
       0.96 Conjugate[t]) (Cosh[(sqr t)/2] - (1.76 Sinh[(sqr t)/2])/
        sqr) (-0.88 Cosh[(sqr t)/2] + 
        1/2 sqr Sinh[(sqr t)/2]) Derivative[1][Conjugate][
       Cosh[(sqr t)/2] - (1.76 Sinh[(sqr t)/2])/sqr]))/(4 Conjugate[
    Cosh[(sqr t)/2] - (1.76 Sinh[(sqr t)/2])/sqr] (Cosh[(sqr t)/2] - (
     1.76 Sinh[(sqr t)/2])/sqr)

This gives me 54.1743 (-0.0204715 - 0.0204715 Derivative[1][Conjugate][0.177417] + 0.00461473 (-0.96 - 0.96 Derivative[1][Conjugate][1])) when a value for t is passed in. As you can see, the issue is the unevaluated D[conjugate[t],t], which prevents me from obtaining a plottable value. I have attempted to make use of Inactivate and activate, as other posts with a similar issue have mentioned, but this doesn't seem to be addressing the issue.

As I see it, I need all derivatives w.r.t t to be evaluated before the replace all comes into play for any value of t, which I thought inactivate and activate would allow. But this does not seem to be the case, as I just get the value of t is not a variable, which makes sense given its trying then to take the derivative with respect to a number. What am I missing here?

Edit: I will also say that there are, obviously, a few more variable passed in here that are not mentioned, but since they are not causing an issue with the derivation, I have omitted them from the code.

$\endgroup$
3
  • 1
    $\begingroup$ Conjugate isn't a differentiable function. $\endgroup$
    – John Doty
    Sep 16, 2021 at 15:37
  • $\begingroup$ Yes but given one of it's variable is t, then I can't just omit it from the Derivative. $\endgroup$ Sep 16, 2021 at 15:44
  • $\begingroup$ If t and sqr are to be treated as real, try D[ComplexExpand[expr], t]. Variables in Mma are treated as complex by default. $\endgroup$
    – Michael E2
    Sep 16, 2021 at 18:35

1 Answer 1

3
$\begingroup$

If expr is your expression with the Inactivate, and you're looking for a complex (Wirtinger) derivative, then we can use ResourceFunction["ComplexD"] and simplify assuming t is real valued:

FullSimplify[
 ResourceFunction["ComplexD"][expr, t]
 , t ∈ Reals]

Which gives us:

(-0.92 sqr Cosh[(sqr t)/2] + (0.8448 + 0.25 sqr^2) Sinh[(sqr t)/2])/(
sqr Cosh[(sqr t)/2] - 1.76 Sinh[(sqr t)/2])

If you use RealD from that page:

RealD[f_, z_] := 
 ResourceFunction["ComplexD"][f, z] + 
  ResourceFunction["ComplexD"][f, Conjugate[z]]

Then we get:

FullSimplify[
 RealD[expr, t]
 , t ∈ Reals]

Result:

(-1.4 sqr Cosh[(sqr t)/
     2] + (Conjugate[-0.88 Cosh[(sqr t)/2] + 
        0.5 sqr Sinh[(sqr t)/2]] (0.5 sqr Cosh[(sqr t)/2] - 
        0.88 Sinh[(sqr t)/2]))/
    Conjugate[
     Cosh[(sqr t)/2] - (1.76 Sinh[(sqr t)/2])/sqr] + (1.6896 + 
      0.25 sqr^2) Sinh[(sqr t)/2])/(sqr Cosh[(sqr t)/2] - 
   1.76 Sinh[(sqr t)/2])

If you don't care about Conjugate then you could just do:

FullSimplify[D[expr /. Conjugate -> Identity, t]]
$\endgroup$
2
  • $\begingroup$ To be clear, I am not trying to get a complex derivative. I am trying to take the derivative of this function, and for some reason mathematica is trying to take the derivative of the conjugate of t, which is a real variable. I am then trying to use replaceAll, and this ends up replacing the variable with which derivation is being taken w.r.t $\endgroup$ Sep 16, 2021 at 15:58
  • $\begingroup$ @GaussStrife You cannot take the usual derivative, so use RealD. Obviously it will differentiate Conjugate[t] because that appears in your original expression. It's not differentiable in the usual way so you have to use the complex derivative. If you think all parts of the expression are real, then just do D[(expr /. Conjugate -> Identity) , t] to the original expression. $\endgroup$
    – flinty
    Sep 16, 2021 at 16:55

Your Answer

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

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