Sorry if this is a newbie question, but I could not find a solution.

Say I have two functions, like:

A[x_, y_] := x + y^2;
B[a_, b_] := Integrate[A[x, 1], {x, b, 2}];

How would I go about printing the function B?

Actual output:


Ideal output:

4 - b - (b ^ 2) / 2

Basically I'd like to print the body of the function in simplified format, expanding my function calls and integration.


1 Answer 1

?? A




?? B

B[a_,b_]:=!( *SubsuperscriptBox[([Integral]), (b), (2)](A[x, 1] [DifferentialD]x))

or just A[x,y], which gives:

$x + y^2$

Never use upper-case letters for functions or variables, since they are likely to conflict with Mathematica's internal symbols.

Also, you define B as an integral, so that is the function. If you want to evaluate that first, you must do:

B[a, b]



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.