Skip to main content
1 of 9
l4m2
  • 28.5k
  • 2
  • 25
  • 103

Polynominal -> Integrate

Given a polynominal, each coefficient of which is rational, with one argument, output an expression with only 1, definite integral, and variables, that equals to it. E.g. -x2 can be expressed as ∫x111dtxdu.

E := 1 | var | ∫EEEdvar

Reasonable input/output method allowed

Samples:

\Large 1=1\ \Large x=x\ \Large 0 = \int_1^1 1\text dt\ \Large 2 = \int_{\int_1^{\int_1^1 1\text dv} 1\text du}^1 1\text dt\ \Large x^2=\int_{\int_1^1 1\text dt}^x x\text dv\ \Large \frac 12=\int_{\int_1^1 1\text dt}^1 v\text dv

Your score will be the your code length multiply how many symbol used on the test cases. You should be able to score your program. Lowest score win.

Test cases:

4/381*x^2+49/8*x^3-17/6
311/59*x^2-92/9*x^3-7/15*x
333/29*x^3+475/96*x^8
l4m2
  • 28.5k
  • 2
  • 25
  • 103