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
POSTED BY: Adam Strzebonski

And here's the simple answer, that you probably expect your students to find...

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

Out[21]//InputForm= {{c -> -2/3 + 8/(9*Pi)}}
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