Schaum's integration example does not work

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

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*)