Group Abstract Group Abstract

Message Boards Message Boards

Solve with Integrate wouldn't produce correct answers

Posted 2 years ago

Hello,

In my book, there is an exercise:

f(x,y) is continuous over a closed region of D={(x,y)|x^2+y^2<=y,x>=0}, and f(x,y)=Sqrt[1-x^2-y^2]-8/Pi*Integrate[f(x,y),dy,dx]

In Mathematica

Solve[f[x, y] == 
   Sqrt[1 - x^2 - y^2] - 
    8/Pi*Integrate[
      f[x, y], {x, 0, 1/2}, {y, -Sqrt[1/4 - x^2] + 1/2, 
       Sqrt[1/4 - x^2] + 1/2}], f[x, y]] // Simplify

produces

{{f[x, y] -> 1/2 Sqrt[1 - x^2 - y^2]}}

But the right answer should be

Sqrt[1-x^2-y^2]+8/9/Pi-2/3

So, what the reason for Mathematica to produce that answer?

POSTED BY: Zhenyu Zeng
7 Replies

Possibly, though currently the problem can easily be solved. You just need to separate the integral computation from the algebraic equation solving. The integral computation does take about 20 minutes.

f = Sqrt[1 - x^2 - y^2] + c;  

eqn = (c == -8/Pi*Integrate[f, {x, 0, 1/2}, 
   {y, -Sqrt[1/4 - x^2] + 1/2, Sqrt[1/4 - x^2] + 1/2}]);    

In[16]:= Solve[eqn, c]//FullSimplify//InputForm                                 

Out[16]//InputForm= 
{{c -> (32 - 24*Pi + 6*(-1)^(1/6)*Log[2 + (-1)^(1/6)*Sqrt[2]] + 
     3*Sqrt[3]*Log[5 - 2*Sqrt[6]] + 
     (3*I)*Log[(3 - Sqrt[6] + Root[36 + 60*#1^2 + #1^4 & , 3, 0])/3] - 
     3*Sqrt[3]*Log[Root[3 - 12*#1 + 34*#1^2 - 12*#1^3 + 3*#1^4 & , 2, 0]] + 
     3*((-I)*Pi + Log[-2 + (-1)^(1/6)*Sqrt[2]])*Root[16 - 4*#1^2 + #1^4 & , 1, 
       0])/(36*Pi)}}
POSTED BY: Adam Strzebonski
POSTED BY: Adam Strzebonski
Posted 2 years ago

What computer configuration are you using? I've been calculating for 2 hours but still no results.

POSTED BY: Updating Name
POSTED BY: Adam Strzebonski
Posted 2 years ago

Do you think Mathematica should develop this function to calculate this kind of function?

POSTED BY: Zhenyu Zeng

The answer of Solve is rubbish, and the reason may be that you fed it a integral functional equation, for which Solve is not prepared.

Here is a possible derivation of the solution:

reg = ImplicitRegion[x^2 + y^2 <= y && x >= 0, {x, y}];
eq = f[x, y] == Sqrt[1 - x^2 - y^2] -
   8/Pi*Inactive[Integrate][f[x, y], Element[{x, y}, reg]]
generalFormOfF = f[x, y] :> Sqrt[1 - x^2 - y^2] + c
eq /. generalFormOfF
% // Simplify
% /. Inactive[Integrate][a_ + b_, w__] :>
  Inactive[Integrate][a, w] + Inactive[Integrate][b, w]
% /. Inactive[Integrate][c, w__] :> Integrate[c, w]
Solve[%, c]
f[x, y] == Sqrt[1 - x^2 - y^2] + c /. %[[1]]
% /.
 Inactive@Integrate -> NIntegrate

Unfortunately, the exact value of the integral seems to take a very long time.

POSTED BY: Gianluca Gorni
Posted 2 years ago

I think it's okay if the Solve function cannot solve the problem, but it's a bit unacceptable to give the wrong answer without any hint.

POSTED BY: Zhenyu Zeng
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard