I am a new user of Mathematica and have some questions about the simplifications of calculated expressions. I am unable to attach an image of the session, but my Mathematica commands are:
Element[{x,y,z},Reals]
Element[{x0,y0,z0},Reals]
rhatV={x-x0,y-y0,z-z0}
rhat=Norm[rhatV]
In the expression for rhat, I am unable to get rid of the Abs
functions, despite the Reals declarations.
phi=1/rhat
D[phi,x]
In the evaluated derivative is there a way to have x-x0 in the numerator recognized as rhatV[[1]] and the denominator as rhat^3, such that it can be used in additional operations?
Answer
The formulation of the assumptions are one problem, and the fact that you're not using them is another:
$Assumptions = {Element[{x, y, z}, Reals],
Element[{x0, y0, z0}, Reals]
};
rhatV = {x - x0, y - y0, z - z0};
rhat = Simplify[Norm[rhatV]];
phi = 1/rhat;
D[phi, x]
$-\frac{x-\text{x0}}{\left((x-\text{x0})^2+(y-\text{y0 })^2+(z-\text{z0})^2\right)^{3/2}}$
Here I put the assumptions in a special variable $Assumptions
, assuming (no pun intended) that you'll want to re-use them in further calculations. But to use them in the first place, you have to add Simplify
or another command that specifically utilizes the Assumptions
option.
Comments
Post a Comment