NAME

Math::Polynomial::Chebyshev2 - Chebyshev polynomials of the second kind

SYNOPSIS

use Math::Polynomial::Chebyshev2;

# create a Chebyshev polynomial of the second kind of order 7
my $p = Math::Polynomial::Chebyshev2 -> chebyshev2(7);

# get the location of all roots
my @xn = $p -> roots();

# use higher accuracy
use Math::BigFloat;
Math::BigFloat -> accuracy(60);
my $n_mbf = Math::BigFloat -> new(7);
my $p_mbf = Math::Polynomial::Chebyshev2 -> chebyshev2($n_mbf);

DESCRIPTION

This package extends Math::Polynomial, so each instance polynomial created by this module is a subclass of Math::Polynomial.

The Chebyshev polynomials of the second kind are orthogonal with respect to the weight function sqrt(1-x^2).

The first Chebyshev polynomials of the second kind are

U₀(x) = 1
U₁(x) = 2 x
U₂(x) = 4 x^2 - 1
U₃(x) = 8 x^3 - 4 x
U₄(x) = 16 x^4 - 12 x^2 + 1
U₅(x) = 32 x^5 - 32 x^3 + 6 x
U₆(x) = 64 x^6 - 80 x^4 + 24 x^2 - 1
U₇(x) = 128 x^7 - 192 x^5 + 80 x^3 - 8 x
U₈(x) = 256 x^8 - 448 x^6 + 240 x^4 - 40 x^2 + 1
U₉(x) = 512 x^9 - 1024 x^7 + 672 x^5 - 160 x^3 + 10 x

CLASS METHODS

Constructors

chebyshev2($n)

Math::Polynomial::Chebyshev2->chebyshev2($n) creates a new polynomial of order $n, where $n is a non-negative integer.

# create a Chebyshev polynomial of the second kind of order 7
$p = Math::Polynomial::Chebyshev2 -> chebyshev2(7);

# do the same, but with Math::BigFloat coefficients
use Math::BigFloat;
$n = Math::BigFloat -> new(7);
$p = Math::Polynomial::Chebyshev2 -> chebyshev2($n);

# do the same, but with Math::Complex coefficients
use Math::Complex;
$n = Math::Complex -> new(7);
$p = Math::Polynomial::Chebyshev2 -> chebyshev2($n);

Property Accessors

roots()

$p->roots() returns the location of all root of $p. All roots are located in the open interval (-1,1).

# get the roots of a polynomial
@x = $p -> roots();

BUGS

Please report any bugs through the web interface at https://rt.cpan.org/Ticket/Create.html?Queue=Math-Polynomial-Chebyshev (requires login). We will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Math::Polynomial::Chebyshev

You can also look for information at:

SEE ALSO

LICENSE AND COPYRIGHT

Copyright (c) 2020 Peter John Acklam.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Peter John Acklam <pjacklam (at) gmail.com>.