harmonic - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


harmonic

calculate the harmonic function

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

harmonic(x)

harmonic(x, y)

Parameters

x

-

expression

y

-

expression

Description

• 

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

(1)
• 

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&comma;n::ℤ0&comma;+,harmonic⁡n=∑_k1=1∞⁡n_k1⁢_k1+n&comma;n::¬ℤ−,harmonic⁡n=∑_k2=0∞⁡∑_k1=0∞⁡−1_k1⁢n_k1+1_k2+1_k1+2&comma;n<1

(2)
> 

FunctionAdvisor(sum_form, harmonic(n,z));

harmonic⁡n&comma;z=∑_k1=1n⁡1_k1z&comma;n::ℤ0&comma;+,harmonic⁡n&comma;z=∑_k1=1∞⁡1_k1z−∑_k1=0∞⁡1n+1+_k1z&comma;1<ℜ⁡z,harmonic⁡n&comma;z=∑_k1=1∞⁡−pochhammer⁡z&comma;_k1⁢ζ⁡z+_k1⁢n_k1⁢−1_k1_k1!&comma;n<1∧1<ℜ⁡z

(3)
• 

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.

Examples

> 

harmonic⁡3

116

(4)
> 

harmonic⁡3&comma;2

4936

(5)
> 

harmonic⁡r&comma;s

harmonic⁡r&comma;s

(6)
> 

=convert⁡&comma;Sumassumingr::nonnegint

harmonic⁡r&comma;s=∑_k1=1r⁡1_k1s

(7)
> 

=convert⁡&comma;Ζ

harmonic⁡r&comma;s=ζ⁡s−ζ0⁡s&comma;r+1

(8)
> 

=convert⁡&comma;Ψassumings::posint

harmonic⁡r&comma;s=−1s⁢Ψ⁡s−1&comma;1−Ψ⁡s−1&comma;r+1s−1!

(9)
> 

diff⁡&comma;r

s⁢ζ0⁡s+1&comma;r+1=−−1s⁢Ψ⁡s&comma;r+1s−1!

(10)
> 

evalf⁡eval⁡&comma;r=1043+I2&comma;s=4

−0.2942981267−0.9671639794⁢I=−0.2942981267−0.9671639794⁢I

(11)

Special values for the harmonic function

> 

FunctionAdvisor⁡special_values&comma;harmonic

harmonic⁡0=0&comma;harmonic⁡1=1&comma;harmonic⁡−1=∞+∞⁢I&comma;harmonic⁡∞=∞&comma;harmonic⁡−∞=∞&comma;harmonic⁡0&comma;z=0&comma;harmonic⁡1&comma;z=1&comma;harmonic⁡a&comma;0=a&comma;harmonic⁡a&comma;1=harmonic⁡a&comma;harmonic⁡−1&comma;z=∞+∞⁢I

(12)

See Also

complex infinity

error

FunctionAdvisor

initialfunctions

NumericEvent

NumericEventHandler

Psi

Zeta