I am working on some simple calculations using maple for my assignment. I have an equation say $x=a$, I assigned it in maple like $$x:=a$$ Later in my calculation I got some $y$ as
$$y=a^2+\sin(a)$$
I need $y$ in terms of $x$ not in $a$ like $y=x^2+\sin(x)$.
Please help me in this regard.
You don't need to execute the assignment
x:=a;in order to utilize an equation likex=a.Similarly, you don't have to execute the assignment
n:=(y -> sqrt(b/v)*y);in order to utilize that as a definition of an operator forn.The same thing goes for 2D Input syntax, where you don't need to execute the assignment
n(y):=sqrt(b/v)*y;in order to utilize that as a definition fornas an operator.In other words, if these assignments are getting in your way, then simply don't make them. You can use similar equations instead of those assignments. And you can even utilize them selectively, so that they don't affect all your computations.
For your first example, you can produce either form, with
aor withx.Now
yis in terms of justx.And you don't need to produce the following (unless you want to),
Let's look at your followup example.
The same technique from the earlier example can be used.
Notice that we have not assigned anything to
n.We can make a new equation from
defn,Again, we have not assigned anything to
n. But we can re-evaluate the resultrawabove and utilize thenewequation to make a replacement (substitution).I suspect that you have omitted some assumptions that
bandvare both positive. Under those assumptions the radicals in the resultanswill simplify, and we have a choice of commands that will do that.The moral of the story is this: don't make assignments that you don't want. You can use the
evalcommand withequationsto perform selective substitution.