Message Boards Message Boards

0
|
4648 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

distribute/ square/ sinus

Posted 10 years ago
Attachments:
POSTED BY: chemsou

Every time pattern matching in Mathematica seems not to work, e.g. one has

In[10]:= Expand[b^2 ((Sqrt[k\[Sigma]] m)/(a b) - m^2/a^2)]
Out[10]= (b Sqrt[k\[Sigma]] m)/a - (b^2 m^2)/a^2

but gets nevertheless

In[9]:= Sin[Sqrt[b^2 ((Sqrt[k\[Sigma]] m)/(a b) - m^2/a^2)] \[Pi]] /. Sqrt[o_] -> Sqrt[Expand[o]]
Out[9]= Sin[Sqrt[b^2 ((Sqrt[k\[Sigma]] m)/(a b) - m^2/a^2)] \[Pi]]

the internal representation of the expression using FullForm should be inspected:

In[17]:= FullForm[Sin[Sqrt[b^2 ((Sqrt[k\[Sigma]] m)/(a b) - m^2/a^2)] \[Pi]]]
Out[17]//FullForm= <snip>

doing so you proceed as follows

In[20]:= Sin[Sqrt[b^2 ((Sqrt[k\[Sigma]] m)/(a b) - m^2/a^2)] \[Pi]] /. Power[o_, Rational[1, 2]] :> Power[Expand[o], Rational[1, 2]]
Out[20]= Sin[Sqrt[(b Sqrt[k\[Sigma]] m)/a - (b^2 m^2)/a^2] \[Pi]]
POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract