1

It seems Mathematica does not like it when it is given a function defined by an integral to plot.

How would one plot a function $F(x)=\int_0^x\int_0^xf(t,s)dtds$ on a given interval?

Edit

In particular I'd like to see how the graph of the following looks like:

F[x_] := 
  2 x^2 ((Log[x])^2 - 3 Log [x] + 7/2) + 
  2 (1 - x)^2 ((Log[1 - x])^2 - 3 Log[1 - x] + 7/2) + 
  2 Integrate[(Log[t^2 + s^2])^2, {t, 0, x}, {s, 0, 1 - x}] + 
  1/2 Integrate[(Log[(1 - x)^2 + (t - s)^2])^2, {t, 0, x}, {s, 0, x}] + 
  1/2 Integrate  [(Log[x^2 + (t - s)^2])^2, {t, 0, 1 - x}, {s, 0, 1 - x}]
m_goldberg
  • 107,779
  • 16
  • 103
  • 257
BigM
  • 257
  • 3
  • 10
  • 3
    Would you have a specific example of $F(x)$ in mind? Could you present it in Mathematica code for people to play with? – MarcoB Jul 28 '15 at 17:24
  • 2
    Welcome to Mathematica.SE! I would use Plot and define F in the form F[x_?NumericQ] := .... See http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users/26037#26037. – Michael E2 Jul 28 '15 at 17:32
  • 4
    As noted, it's hard to say anything useful if we don't see the function concerned; different integrands call for different strategies. At the lowest level, you should follow @Michael's prescription, but otherwise there is nothing to say until you edit. – J. M.'s missing motivation Jul 28 '15 at 17:39
  • 2
    People here generally like users to post code as Mathematica code instead of images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find this this meta Q&A helpful – Michael E2 Jul 28 '15 at 19:39

1 Answers1

4

Here is a quick modification that uses numerical integration: since you are interested in plotting the function, numerical results should be just as acceptable:

Clear[F]

F[x_?NumericQ] := 
  2 x^2 ((Log[x])^2 - 3 Log[x] + 7/2) + 2 (1 - x)^2 ((Log[1 - x])^2 - 3 Log[1 - x] + 7/2) + 
  2 NIntegrate[(Log[t^2 + s^2])^2, {t, 0, x}, {s, 0, 1 - x}] + 
  1/2 NIntegrate[(Log[(1 - x)^2 + (t - s)^2])^2, {t, 0, x}, {s, 0, x}] + 
  1/2 NIntegrate[(Log[x^2 + (t - s)^2])^2, {t, 0, 1 - x}, {s, 0, 1 - x}]

Plot[F[x], {x, 0, 1}, PlotPoints -> 10, MaxRecursion -> 2]

Mathematica graphics

Please note, however, that NIntegrate complains considerably during this calculation; you will want to carefully define the domain over which you want to see the plot of $F(x)$.

MarcoB
  • 67,153
  • 18
  • 91
  • 189