0
Code and Solve an Integration function On Python
Can someone please help me with coding and solving this integration function f(x)=x^2e^−xsin(x) on Python programming language. xMin =1, xMax =3, N = 200 I have tried all I could but I only got no output when i run the python compiler. For example I wrote the following code based on the information I found from web sources. a=1 b=3 N=200 def integrate(a, b, N): def f(x): return x**2*math.exp(-x)*math.sin(x) value=0 value2=0 for n in range(1,N+1): value += f(a+((n-(1/2))*((b-a)/N))) v alue2=((b-a)/N)*value return value2 With no outcome. Could you please help. I am stuck here, I am just a beginner.
2 Réponses
+ 7
Could you link your code using the icon circle/plus? As posted, you never called your intgegrate function nor asked for any output.
+ 6
I figured I'd update from what you posted so:
https://code.sololearn.com/cZ5e6gZYMKNW