harmonic
calculate the harmonic function
Calling Sequence
Parameters
Description
Examples
harmonic(x)
harmonic(x, y)
x
-
expression
y
The harmonic function is defined in terms of the Psi and Zeta functions as follows.
FunctionAdvisor(definition, harmonic);
harmonic⁡z=Ψ⁡z+1+γ,with no restrictions on ⁡z,harmonic⁡a,z=ζ⁡z−ζ0⁡z,a+1,with no restrictions on ⁡a,z
When the first parameter is a non-negative integer n, the harmonic function admits a Sum representation
FunctionAdvisor(sum_form, harmonic(n));
harmonic⁡n=∑_k1=1n⁡1_k1,n::ℤ0,+,harmonic⁡n=∑_k1=1∞⁡n_k1⁢_k1+n,n::¬ℤ−,harmonic⁡n=∑_k2=0∞⁡∑_k1=0∞⁡−1_k1⁢n_k1+1_k2+1_k1+2,n<1
FunctionAdvisor(sum_form, harmonic(n,z));
harmonic⁡n,z=∑_k1=1n⁡1_k1z,n::ℤ0,+,harmonic⁡n,z=∑_k1=1∞⁡1_k1z−∑_k1=0∞⁡1n+1+_k1z,1<ℜ⁡z,harmonic⁡n,z=∑_k1=1∞⁡−pochhammer⁡z,_k1⁢ζ⁡z+_k1⁢n_k1⁢−1_k1_k1!,n<1∧1<ℜ⁡z
When the first parameter is a negative integer an exception (error) is raised, signaling the event 'division_by_zero'. This behavior can be controlled using a NumericEventHandler, which will be passed complex infinity as the default value.
When the first parameter is a small non-negative integer and the second parameter, if present, is a non-negative integer, harmonic returns a rational number.
harmonic⁡3
116
harmonic⁡3,2
4936
harmonic⁡r,s
=convert⁡,Sumassumingr::nonnegint
harmonic⁡r,s=∑_k1=1r⁡1_k1s
=convert⁡,Ζ
harmonic⁡r,s=ζ⁡s−ζ0⁡s,r+1
=convert⁡,Ψassumings::posint
harmonic⁡r,s=−1s⁢Ψ⁡s−1,1−Ψ⁡s−1,r+1s−1!
diff⁡,r
s⁢ζ0⁡s+1,r+1=−−1s⁢Ψ⁡s,r+1s−1!
evalf⁡eval⁡,r=1043+I2,s=4
−0.2942981267−0.9671639794⁢I=−0.2942981267−0.9671639794⁢I
Special values for the harmonic function
FunctionAdvisor⁡special_values,harmonic
harmonic⁡0=0,harmonic⁡1=1,harmonic⁡−1=∞+∞⁢I,harmonic⁡∞=∞,harmonic⁡−∞=∞,harmonic⁡0,z=0,harmonic⁡1,z=1,harmonic⁡a,0=a,harmonic⁡a,1=harmonic⁡a,harmonic⁡−1,z=∞+∞⁢I
See Also
complex infinity
error
FunctionAdvisor
inifcns
NumericEvent
NumericEventHandler
Psi
Zeta
Download Help Document