How to declare derivatives of a multivariable function as real in order to get Re and Im part of the expression?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Re
and Im
work properly, with appropriate assumptions, in the example like this
Assuming[g[_, _] â Reals, Simplify[Im[3*I*g[r, r2] + 45]]]
On the other hand, if the derivative of the function is also present, similar approach does not work
Assuming[(r | g[_, _] | D[g[_, _], _]) â Reals, Simplify[Im[3*I*D[g[r, r2], r] + 45]]]
i.e. does not give back 3*D[g[r, r2], r]
More dramatically,
Assuming[(r | g[_, _] | f[_]) â Reals, Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]
gives 3 Re[g[r,r2] (f^â²)[r]+f[r] (g^(1,0))[r,r2]]
.
In real problem, I have the function of four variables and mixed partial derivatives, so it would be great if there is some generic way to prescribe all of function's derivatives as Real.
calculus-and-analysis functions function-construction symbolic complex
add a comment |Â
up vote
2
down vote
favorite
Re
and Im
work properly, with appropriate assumptions, in the example like this
Assuming[g[_, _] â Reals, Simplify[Im[3*I*g[r, r2] + 45]]]
On the other hand, if the derivative of the function is also present, similar approach does not work
Assuming[(r | g[_, _] | D[g[_, _], _]) â Reals, Simplify[Im[3*I*D[g[r, r2], r] + 45]]]
i.e. does not give back 3*D[g[r, r2], r]
More dramatically,
Assuming[(r | g[_, _] | f[_]) â Reals, Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]
gives 3 Re[g[r,r2] (f^â²)[r]+f[r] (g^(1,0))[r,r2]]
.
In real problem, I have the function of four variables and mixed partial derivatives, so it would be great if there is some generic way to prescribe all of function's derivatives as Real.
calculus-and-analysis functions function-construction symbolic complex
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Re
and Im
work properly, with appropriate assumptions, in the example like this
Assuming[g[_, _] â Reals, Simplify[Im[3*I*g[r, r2] + 45]]]
On the other hand, if the derivative of the function is also present, similar approach does not work
Assuming[(r | g[_, _] | D[g[_, _], _]) â Reals, Simplify[Im[3*I*D[g[r, r2], r] + 45]]]
i.e. does not give back 3*D[g[r, r2], r]
More dramatically,
Assuming[(r | g[_, _] | f[_]) â Reals, Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]
gives 3 Re[g[r,r2] (f^â²)[r]+f[r] (g^(1,0))[r,r2]]
.
In real problem, I have the function of four variables and mixed partial derivatives, so it would be great if there is some generic way to prescribe all of function's derivatives as Real.
calculus-and-analysis functions function-construction symbolic complex
Re
and Im
work properly, with appropriate assumptions, in the example like this
Assuming[g[_, _] â Reals, Simplify[Im[3*I*g[r, r2] + 45]]]
On the other hand, if the derivative of the function is also present, similar approach does not work
Assuming[(r | g[_, _] | D[g[_, _], _]) â Reals, Simplify[Im[3*I*D[g[r, r2], r] + 45]]]
i.e. does not give back 3*D[g[r, r2], r]
More dramatically,
Assuming[(r | g[_, _] | f[_]) â Reals, Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]
gives 3 Re[g[r,r2] (f^â²)[r]+f[r] (g^(1,0))[r,r2]]
.
In real problem, I have the function of four variables and mixed partial derivatives, so it would be great if there is some generic way to prescribe all of function's derivatives as Real.
calculus-and-analysis functions function-construction symbolic complex
calculus-and-analysis functions function-construction symbolic complex
edited Sep 22 at 19:14
kglr
163k8188387
163k8188387
asked Sep 22 at 18:02
Thela Hun Ginjeet
445
445
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Use the FullForm
of the derivatives:
Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) â Reals,
Simplify[Im[3*I*D[g[r, r2], r] + 45]]]
Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) â Reals,
Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]
1
Great, it works! FormDerivative[_, _][g][_, _]
allows for generalizing to arbitrary number of derivatives.
â Thela Hun Ginjeet
Sep 23 at 10:50
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Use the FullForm
of the derivatives:
Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) â Reals,
Simplify[Im[3*I*D[g[r, r2], r] + 45]]]
Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) â Reals,
Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]
1
Great, it works! FormDerivative[_, _][g][_, _]
allows for generalizing to arbitrary number of derivatives.
â Thela Hun Ginjeet
Sep 23 at 10:50
add a comment |Â
up vote
3
down vote
accepted
Use the FullForm
of the derivatives:
Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) â Reals,
Simplify[Im[3*I*D[g[r, r2], r] + 45]]]
Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) â Reals,
Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]
1
Great, it works! FormDerivative[_, _][g][_, _]
allows for generalizing to arbitrary number of derivatives.
â Thela Hun Ginjeet
Sep 23 at 10:50
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Use the FullForm
of the derivatives:
Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) â Reals,
Simplify[Im[3*I*D[g[r, r2], r] + 45]]]
Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) â Reals,
Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]
Use the FullForm
of the derivatives:
Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) â Reals,
Simplify[Im[3*I*D[g[r, r2], r] + 45]]]
Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) â Reals,
Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]
edited Sep 22 at 20:17
answered Sep 22 at 18:48
kglr
163k8188387
163k8188387
1
Great, it works! FormDerivative[_, _][g][_, _]
allows for generalizing to arbitrary number of derivatives.
â Thela Hun Ginjeet
Sep 23 at 10:50
add a comment |Â
1
Great, it works! FormDerivative[_, _][g][_, _]
allows for generalizing to arbitrary number of derivatives.
â Thela Hun Ginjeet
Sep 23 at 10:50
1
1
Great, it works! Form
Derivative[_, _][g][_, _]
allows for generalizing to arbitrary number of derivatives.â Thela Hun Ginjeet
Sep 23 at 10:50
Great, it works! Form
Derivative[_, _][g][_, _]
allows for generalizing to arbitrary number of derivatives.â Thela Hun Ginjeet
Sep 23 at 10:50
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182365%2fhow-to-declare-derivatives-of-a-multivariable-function-as-real-in-order-to-get-r%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password