Skip to main content
4 of 4
added 133 characters in body
image_doctor
  • 10.3k
  • 23
  • 41

Here is an alternate way of structuring the definition of your function that avoids the use of If completely by employing a combination of conditional expression evaluation and argument pattern matching:

j[x_, n_, l_] := 0 /; l < n
j[x_, l_, l_] := x^l
j[x_, n_, l_] := (1-x)/(1 + x^l)*(Sum[j[x, n-1-i,l]*x^i, {i,0,l-1}]) + x^l/(1+x^l)

And plotted:

Plot[j[x, 7, 7], {x, 0, 1}]

Mathematica graphics

image_doctor
  • 10.3k
  • 23
  • 41