Message Boards Message Boards

0
|
4426 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Can't get my expressions to simplify

Posted 10 years ago
Hello all!
I need some help.  This is my first time using Mathematica for an assignment, and my teacher and I are stumped.  I have put in two equations that define a third.  When I try to put in a number for x, Mathematica won't give me a simplified answer.  I have tried the Simplify, FullSimplify, N, ?NumericQ, and a few other commands I can't think of.  It just keeps giving me this expression with pi and some decimals but never an actually numeric answer, which is what I need.  What am I doing wrong?
R[x_] := 2 + Sqrt[1-x^2]
r[x_] := 2 - Sqrt[1 - x^2]
A[x_?NumericQ] := [Pi][R[x]]^2 - [Pi][r[x]]^2

(1/2)A[1/2]
1/2 (-\[Pi][2 - Sqrt[3]/2]^2 + \[Pi][1/2 (4 + Sqrt[3])]^2)
The last part is what I keep getting.  Sometimes I can get it to give me decimals instead of pi and the radicals, but it won't actually solve the equation.  Can anyone tell me why?
Thanks!
2 Replies
You are a lifesaver!  Thank you so much!  It's working for me now.
Posted 10 years ago
 In[1]:= R[x_] := 2 + Sqrt[1 - x^2];
 r[x_] := 2 - Sqrt[1 - x^2];
 A[x_?NumericQ] := Pi R[x]^2 - Pi r[x]^2;
 (1/2) A[1/2]
 
 Out[4]= 1/2 (-(2 - Sqrt[3]/2)^2 ? + (2 + Sqrt[3]/2)^2 ?)
 
 In[5]:= Simplify[%]
 
Out[5]= 2 Sqrt[3] ?
Misuse of [ and ]. Mathematica is FANATIC about exactly correct use of () and [ ] and {}. Each of those mean completely different things to it. Use one where another was required and you will get incorrect output, error messages you don't know how to interpret or even nothing at all. The same goes for capitalization and = versus := versus == and there is even an === and they are all completely different.
POSTED BY: Bill Simpson
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