# Derivative with respect to a variable is leaving unevaluated derivatives of functions

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.

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

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]]

• 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 Sep 16, 2021 at 15:58
• @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. Sep 16, 2021 at 16:55