Skip to content

Commit 2faef51

Browse files
committed
1 parent d479ff5 commit 2faef51

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/builtin/SpecialFunctions.java

+14
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,20 @@ private IExpr polyLogSymbolic(IExpr n, IExpr p, IExpr z) {
19791979
if (z.isZero()) {
19801980
return F.C0;
19811981
}
1982+
if (n.isOne()) {
1983+
int pInt = p.toIntDefault();
1984+
if (pInt > 1) {
1985+
// https://functions.wolfram.com/ZetaFunctionsandPolylogarithms/PolyLog3/03/01/03/0002/
1986+
IExpr v4 = F.CN1.pow(pInt);
1987+
IExpr sum = F.sum(k -> F.Times(F.Power(F.Factorial(F.Plus(F.CN1, F.Negate(k), p)), F.CN1),
1988+
F.Power(F.CN1, k), F.Power(F.Log(F.Subtract(F.C1, z)), F.Plus(F.CN1, F.Negate(k), p)),
1989+
F.PolyLog(F.Plus(k, F.C2), F.Subtract(F.C1, z))), 0, pInt - 1);
1990+
return F.Plus(
1991+
F.Times(v4, F.Power(F.Factorial(p), F.CN1),
1992+
F.Power(F.Log(F.Subtract(F.C1, z)), p), F.Log(z)),
1993+
F.Times(v4, sum), F.Zeta(F.Plus(p, F.C1)));
1994+
}
1995+
}
19821996
if (p.isOne()) {
19831997
return F.PolyLog(n.inc(), z);
19841998
}

symja_android_library/matheclipse-core/src/test/java/org/matheclipse/core/system/LowercaseTestCase.java

+6
Original file line numberDiff line numberDiff line change
@@ -18372,6 +18372,12 @@ public void testPolyGamma() {
1837218372
public void testPolyLog() {
1837318373
// check("PolyLog(10007,-1.5707963267948966)", //
1837418374
// "");
18375+
check("PolyLog(1, 3, z)", //
18376+
"Pi^4/90-1/6*Log(1-z)^3*Log(z)-1/2*Log(1-z)^2*PolyLog(2,1-z)+Log(1-z)*PolyLog(3,1-z)-PolyLog(\n" //
18377+
+ "4,1-z)");
18378+
check("PolyLog(1, 4, z)", //
18379+
"1/24*Log(1-z)^4*Log(z)+1/6*Log(1-z)^3*PolyLog(2,1-z)-1/2*Log(1-z)^2*PolyLog(3,1-z)+Log(\n" //
18380+
+ "1-z)*PolyLog(4,1-z)-PolyLog(5,1-z)+Zeta(5)");
1837518381
check("PolyLog(-42,Infinity)", //
1837618382
"Indeterminate");
1837718383
check("PolyLog(0,Infinity)", //

0 commit comments

Comments
 (0)