Integrate a Hermite series over axis 1 in Python

To integrate a Hermite series over a specific axis, use the hermite.hermint() method in Python. This function integrates Hermite series coefficients along the specified axis, which is useful for multidimensional polynomial operations.

Parameters

The hermite.hermint() method accepts the following parameters:

  • c: Array of Hermite series coefficients. For multidimensional arrays, different axes correspond to different variables
  • m: Order of integration (must be positive, default: 1)
  • k: Integration constant(s) (default: [])
  • lbnd: Lower bound of the integral (default: 0)
  • scl: Scalar multiplier applied after each integration (default: 1)
  • axis: Axis over which the integral is taken

Example

Let's create a multidimensional array and integrate the Hermite series over axis 1 ?

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

# Create a multidimensional array of coefficients
c = np.arange(4).reshape(2,2)

# Display the array
print("Our Array...\n", c)

# Check the Dimensions
print("\nDimensions of our Array...\n", c.ndim)

# Get the Datatype
print("\nDatatype of our Array object...\n", c.dtype)

# Get the Shape
print("\nShape of our Array object...\n", c.shape)

# Integrate the Hermite series over axis 1
print("\nResult...\n", H.hermint(c, axis=1))
Our Array...
 [[0 1]
 [2 3]]

Dimensions of our Array...
2

Datatype of our Array object...
int64

Shape of our Array object...
(2, 2)

Result...
 [[0.5 0.  0.25]
 [1.5 1.  0.75]]

How It Works

When integrating over axis 1, the function processes each row independently. The original 2×2 array becomes a 2×3 array because integration adds one more coefficient to represent the integrated polynomial. Each coefficient is integrated according to Hermite polynomial integration rules.

Conclusion

The hermite.hermint() method with axis=1 parameter integrates Hermite series coefficients along the specified axis. This is particularly useful for multidimensional polynomial calculations where you need to integrate along specific dimensions.

Updated on: 2026-03-26T20:36:45+05:30

235 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements