#Variable declaration
u=0.927*10**-23#amp-m2
B=1#in J/amp-m2
#Calculations
E=2*u*B
#Result
print "Energy supplied to the dipole is %.2e J "%E
#Variable declaration
#From previous derivation of formula
delb_by_delz=10#tesla/m
u=0.927*10**-23#amp-m2
x=1#/in m
k=1.38*10**-23#j/k
T=400#in K
#Calculations
Z=(delb_by_delz*u*x**2)/(8*k*T)
#Result
print "Transverse deflection that occur is + %.1e m or - %.1e m "%(Z,Z)
#Variable declaration
m=9*10**-31#in kg
e=1.6*10**-19#in coul
c=3*10**8#in m/s2
four_pi_epsilon=1.1*10**-34#in j-sec
constant=9*10**9#nt-n2/coul2
#Calculations
delta_E=(constant**4*m*e**8)/(54*c*c*(four_pi_epsilon)**4)
#Result
print "The energy deflection is %.1e Joule"%delta_E
#Answer given in the book is wrong
#Variable declaration
u_s=10**-23#amp-m2
u_b=10**-23#amp-m2
#Calculations
B=u_s/u_b
#Result
print "The deflection is %d Tesla "%B