1
$\begingroup$

How can I force Mathematica to use the identities satisfied by Jacobi polynomials $$ (1-\cdot)P_n^{(\alpha+1,\beta)} = \frac{2}{2n+\alpha+\beta+2}\left((n+\alpha+1)P_n^{(\alpha,\beta)}-(n+1)P_{n+1}^{(\alpha,\beta)}\right) $$ $$ (1+\cdot)P_n^{(\alpha,\beta+1)} = \frac{2}{2n+\alpha+\beta+2}\left((n+\beta+1)P_n^{(\alpha,\beta)}+(n+1)P_{n+1}^{(\alpha,\beta)}\right) $$ to simplify expressions involving this polynomials in the sense that it is more preferable to have many Jacobi Polynomials multiplied by constants than a few multiplied by explicit monomials.

By using FullSimplify with Assumptions to tell Mathematica that both $\alpha$ and $\beta$ are greater than $-1$ I still obtain expressions containing products of Jacobi polynomials with $(1-t)$ or $(1+t)$

Simple example

When I input

FullSimplify[(1 - x) JacobiP[n, \[Alpha]+1, \[Beta], x], Assumptions ->   n \[Element] Integers && n > 0 && \[Alpha] > -1 && \[Beta] > -1 && x \[Element] Reals]

Mathematica just returns

-(-1 + x) JacobiP[n, \[Alpha]+1, \[Beta], x]

whereas I would like to get

2/(2 n + \[Alpha] + \[Beta] + 2) ((n + \[Alpha] + 1) JacobiP[n, \[Alpha], \[Beta], x] - (n + 1) JacobiP[n + 1, \[Alpha], \[Beta], x])
$\endgroup$
6
  • 2
    $\begingroup$ Please edit your question to include a few simple examples of expressions that you believe should simplify by using this information. $\endgroup$
    – Bob Hanlon
    May 31, 2020 at 0:08
  • $\begingroup$ Thanks for your comment, I added the desired example $\endgroup$ May 31, 2020 at 0:23
  • 1
    $\begingroup$ It is not clear to me what "simpler" expression you are expecting for the example (i.e., a single Jacobi polynomial) and how it relates to the identities given. $\endgroup$
    – Bob Hanlon
    May 31, 2020 at 0:38
  • 3
    $\begingroup$ Mathematica knows this identity, e.g. evaluating FullSimplify[(1 - x) JacobiP[n, a+1, b, x]-2/(2n+a+b+2) ((n+a+1)JacobiP[n, a, b, x]-(n+1)JacobiP[n+1, a, b, x])] yields 0. $\endgroup$
    – Artes
    May 31, 2020 at 0:59
  • $\begingroup$ @BobHanlon I added more detail $\endgroup$ May 31, 2020 at 1:03

1 Answer 1

2
$\begingroup$

If you want to put an expression into a specific form, particularly if the desired form is not simpler in the normal sense (i.e., using the default complexity function), it may be easier using replacement rules along with ReplaceAll

Clear["Global`*"]

The given identities are equivalent to these rules.

repl = {(1 - t_)*JacobiP[n_, α_, β_, t_] :> 
    2/(2 n + α + β + 1)*
     ((n + α)*JacobiP[n, α - 1, β, t] -
       (n + 1)*JacobiP[n + 1, α - 1, β, t]),
   (1 + t_)*JacobiP[n_, α_, β_, t_] :> 
    2/(2 n + α + β + 1)*
     ((n + β)*JacobiP[n, α, β - 1, t] +
       (n + 1)*JacobiP[n + 1, α, β - 1, t])};

expr1 = (1 - x) JacobiP[n, α, β, x];

expr2 = expr1 /. repl

(* (1/(1 + 2 n + α + β))2 ((n + α) JacobiP[
     n, -1 + α, β, x] - (1 + n) JacobiP[
     1 + n, -1 + α, β, x]) *)

Verifying,

expr1 == expr2 // FullSimplify

(* True *)

Similarly,

expr3 = (1 + x) JacobiP[n, α, β, x];

expr4 = expr3 /. repl

(* (1/(1 + 2 n + α + β))2 ((n + β) JacobiP[
     n, α, -1 + β, x] + (1 + n) JacobiP[
     1 + n, α, -1 + β, x]) *)

Verifying,

expr3 == expr4 // FullSimplify

(* True *)
$\endgroup$
3
  • $\begingroup$ Thanks for your detailed and fast answer, I'll give it a try and let you know. $\endgroup$ May 31, 2020 at 1:26
  • $\begingroup$ In which order are the rules in 'repl' applied? $\endgroup$ May 31, 2020 at 1:27
  • $\begingroup$ A rule is applied only if its LHS (pattern) matches a subexpression. In the examples given, only one rule applies. In more complex expressions they could both apply, they would then be applied sequentially in the order given. For more complex expressions you might also want to look at ReplaceRepeated $\endgroup$
    – Bob Hanlon
    May 31, 2020 at 1:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.