Amisha Shah wrote:
> I currently have a nonlinear equation which includes an integral and
> would like to solve for x.
> For example (in real situation, eqn can't be solved algebraically):
> x = x^2+integral of x*y dy from 0 to 1
integral in x*y dy over a range would treat x as a constant and be x *
integral(f(y) dy) over the range. The above could thus be rewritten as
x^2 + x * ( integral( f(y) dy over 0 to 1 )  1 ) = 0
the integral would be a constant as far as this quadratic was concerned,
so this could be solved easily.
You have asserted that this cannot be solved algebraically. If that is
true even after this rewriting, then you must be asserting that the
integral cannot be done symbolically, which would answer your question
about integrating symbolically  if you *can* integrate symbolically
then you *can* solve the equation algebraically.
> I would then like to solve for x using lsqnonlin, but I'm currently
> unsure of how to code for the integral.
I believe someone showed you how to set this up in lsqnonlin when you
posted this question previously except with a more definite equation.
