Problem in trying to define an integrating function in Mathematica

31 Views Asked by At

I need to define a function that integrates a function in some interval and returns its numerical value. I am not allowed to use built in functions for integrating in Mathematica.

This is my code that won't work: http://pokit.org/get/?93856fe8f2070ba781028f8634b9ac3a.jpg

This is a code from a friend that works: http://pokit.org/get/?d712a81fb8c3078f4d8ad60a43b7bf0e.jpg

We are both using Wolfram Mathematica 8.0. I don't know what's wrong with my code, and why I can't obtain a normal numerical result?

1

There are 1 best solutions below

3
On

Somewhere earlier (off screen from what you've shown) you have set $f$ equal to $x$ with a statement like:

f=x

You can tell this due to the repeating expression: $1.0001[1.0001]$, $1.0002[1.0002]$, etc where it is trying to evaluate $f[x]$.

You can fix this with:

Clear[f]