h=float(input("h="))
n=float(input("n="))
print("x\tFx")
x=a
while x
s=-2
i=int(1)
while i<=n:
s=s+(-6*(-1)**i/i*sin(i*x))
i=i+1
x=x+h
print("%3.4f" % x,"\t","%3.4f" %s)
Natija:
a=-3.14
b=3.14
h=0.1
n=10
x Fx
-3.0400 -2.0956
-2.9400 -7.7053
-2.8400 -11.3327
-2.7400 -12.2134
-2.6400 -11.0871
-2.5400 -9.5026
-2.4400 -8.6903
-2.3400 -8.8554
-2.2400 -9.3366
-2.1400 -9.3651
-2.0400 -8.7335
-1.9400 -7.8629
-1.8400 -7.3191
-1.7400 -7.2828
-1.6400 -7.4403
-1.5400 -7.3363
-1.4400 -6.8124
-1.3400 -6.1233
-1.2400 -5.6572
-1.1400 -5.5563
-1.0400 -5.6014
-0.9400 -5.4478
-0.8400 -4.9644
-0.7400 -4.3480
-0.6400 -3.9150
-0.5400 -3.7888
-0.4400 -3.7870
-0.3400 -3.6111
-0.2400 -3.1423
-0.1400 -2.5541
-0.0400 -2.1356
0.0600 -2.0035
0.1600 -1.9884
0.2600 -1.8042
0.3600 -1.3334
0.4600 -0.7454
0.5600 -0.3297
0.6600 -0.2074
0.7600 -0.2054
0.8600 -0.0236
0.9600 0.4657
1.0600 1.0818
1.1600 1.5057
1.2600 1.5985
1.3600 1.5537
1.4600 1.7201
1.5600 2.2542
1.6600 2.9431
1.7600 3.3922
1.8600 3.4172
1.9600 3.2593
2.0600 3.3850
2.1600 4.0260
2.2600 4.8986
2.3600 5.4163
2.4600 5.2572
2.5600 4.7688
2.6600 4.7651
2.7600 5.7844
2.8600 7.4010
2.9600 8.2400
3.0600 6.8255
3.1600 2.6910
Do'stlaringiz bilan baham: |