Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: multiintegral and table
Replies: 1   Last Post: Sep 15, 2013 7:00 AM

 Bob Hanlon Posts: 906 Registered: 10/29/11
Re: multiintegral and table
Posted: Sep 15, 2013 7:00 AM

You cannot use _ (represents Blank[ ] ) in a variable or function name.

f1[x_, y_] = Integrate[2*y + x^2, {x, 0, 1}, {y, 0, x}]

7/12

f2[x_, y_, Q_] = Integrate[2*y + x^2*Q, {x, 0, 1}, {y, 0, x}]

1/3 + Q/4

ftotal[x_, y_, Q_] = f1[x, y] + f2[x, y, Q]

11/12 + Q/4

dataxx = Table[{Q, ftotal[x, y, Q]}, {Q, 0, 10, 1/400}];

ListPlot[dataxx]

Your function ftotal lends itself to using much sparser data sampling

dataxx2 = Table[{Q, ftotal[x, y, Q]}, {Q, 0, 10, 5}]

{{0, 11/12}, {5, 13/6}, {10, 41/12}}

ListPlot[dataxx2, Joined -> True, PlotStyle -> Thick]

ListLinePlot[dataxx2, PlotStyle -> Thick]

Bob Hanlon

On Sat, Sep 14, 2013 at 6:03 AM, Parada Hutauruk <phutauruk@gmail.com>wrote:

> Dear all,
>
> I have a function
>
> f_1 [x_,y_] = Integrate[2*y + x^2, {x,0,1},{y,0,x}]
>
> f_2 [x_,y_,Q_] = Integrate[2*y +x^2*Q, {x,0,1},{y,0,x}]
>
> f_total [x_,y_,Q_] = f_1[x,y] + f_2[x,y,Q]
>
> Then I want to plot the f total using table with Q start from 0 to 10 with
> increment 0.0025.
>
> I have defined by
>
> dataxx = Table[{Q,f_total[x,y,Q]}, {Q, 0,10, 0.0025}]
>
> And Plot the data on the table by
>
> ListPlot[dataxx]
>
> But when I evaluate the function, it took a long time and the plot is not
> yielded. Could anyone help me please to find the bug? I really appreciate
> for help.
>
> Thanks,
> PTPH
>
>