Integrate a Hermite_e series and set the lower bound of the integral in Python

To integrate a Hermite_e series and set a custom lower bound, use the hermite_e.hermeint() method in NumPy. This function performs polynomial integration on Hermite_e series coefficients with flexible integration parameters.

Syntax

numpy.polynomial.hermite_e.hermeint(c, m=1, k=[], lbnd=0, scl=1, axis=0)

Parameters

The function accepts the following parameters ?

  • c ? Array of Hermite_e series coefficients
  • m ? Order of integration (must be positive, default: 1)
  • k ? Integration constants (default: [])
  • lbnd ? Lower bound of the integral (default: 0)
  • scl ? Scalar multiplier applied after each integration (default: 1)
  • axis ? Axis over which integration is performed (default: 0)

Example

Let's integrate a Hermite_e series with different lower bounds ?

import numpy as np
from numpy.polynomial import hermite_e as H

# Create an array of coefficients
c = np.array([1, 2, 3])

# Display the array
print("Coefficients:", c)

# Check basic properties
print("Dimensions:", c.ndim)
print("Datatype:", c.dtype)
print("Shape:", c.shape)

# Integrate with default lower bound (0)
result_default = H.hermeint(c)
print("\nIntegration with lbnd=0:")
print(result_default)

# Integrate with custom lower bound (-2)
result_custom = H.hermeint(c, lbnd=-2)
print("\nIntegration with lbnd=-2:")
print(result_custom)
Coefficients: [1 2 3]
Dimensions: 1
Datatype: int64
Shape: (3,)

Integration with lbnd=0:
[0. 1. 1. 1.]

Integration with lbnd=-2:
[1. 1. 1. 1.]

Multiple Integration Orders

You can perform higher-order integration by setting the m parameter ?

import numpy as np
from numpy.polynomial import hermite_e as H

c = np.array([1, 2, 3])

# First-order integration
result_m1 = H.hermeint(c, m=1, lbnd=-1)
print("First-order integration (m=1):")
print(result_m1)

# Second-order integration
result_m2 = H.hermeint(c, m=2, lbnd=-1)
print("\nSecond-order integration (m=2):")
print(result_m2)
First-order integration (m=1):
[0.5 1.  1.  1. ]

Second-order integration (m=2):
[0.25 0.5  0.5  0.5  0.5 ]

Integration with Constants

Use the k parameter to specify integration constants ?

import numpy as np
from numpy.polynomial import hermite_e as H

c = np.array([1, 2, 3])

# Integration with custom constant
result_with_k = H.hermeint(c, k=[5], lbnd=-1)
print("Integration with k=[5]:")
print(result_with_k)

# Integration with multiple constants for higher order
result_higher = H.hermeint(c, m=2, k=[2, 3], lbnd=-1)
print("\nSecond-order integration with k=[2, 3]:")
print(result_higher)
Integration with k=[5]:
[5.5 1.  1.  1. ]

Second-order integration with k=[2, 3]:
[2.25 3.5  0.5  0.5  0.5 ]

How It Works

The hermeint() function integrates each term of the Hermite_e polynomial series. The lower bound lbnd determines where the definite integral starts, affecting the constant term of the result. When lbnd is non-zero, the integration constant is adjusted accordingly.

Conclusion

Use hermite_e.hermeint() to integrate Hermite_e series with custom lower bounds. The lbnd parameter controls the integration starting point, while m and k parameters allow for higher-order integration and custom constants.

Updated on: 2026-03-26T21:13:46+05:30

208 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements