Message Boards Message Boards

0
|
4850 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Schaum's integration example does not work

Posted 11 years ago
Dear:

The  commands bellow should result in A[4]= 8Pi but as you can see the result was undefined. Should you help me?
In[294]:= x[y_] = Sqrt[16 - y^2];

A[h_] = 2 Integrate[x[y], {y, 0, h}];
A[4]
Out[293]= Undefined
Thanks,
Ana
POSTED BY: Ana Squadri
Ana,
You may have intended to use set-delayed (in other words, definitions where the right-hand-side isn't evaluated until your function is called).
Clear[x, y, A, h]
x[y_] := Sqrt[16 - y^2] (*note use of := which is set delayed.*)
A[h_] := 2 Integrate[x[y], {y, 0, h}]
In your example,  try leaving out the trailing semi-colon and you will see why it didn't work.
Clear[x, y, A, h]
x[y_] = Sqrt[16 - y^2]
A[h_] = 2 Integrate[x[y], {y, 0, h}] (*results in an expression with a condition on h*)
POSTED BY: W. Craig Carter
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