Your goal is to write a program that will print out the Laplace transform of a polynomial function with integer coefficients \$f(x)\$. The Laplace transform of \$f(x)\$ is defined as \$\int_0^\infty f(x) e^{-sx} dx\$.
The standard input for the polynomial function will be
a+bx+cx^2+dx^3+...
If the coefficient is zero, that term is omitted. It can be taken in from any standard type of input.
This is valid input: 1+x^2-5x^4+20x^5
These aren't:
0
1+0x
1+x^1
x^0+x
You may output from any standard type of output, in any readable order. Trailing newline is permitted. No using built in evaluation functions.
Examples:
Input: 1
Output: 1/s
Input: 3-x
Output: 3/s-1/s^2
This is code golf, so the shortest entry in bytes wins.
1
is1/s
, not-1/s
. \$\endgroup\$0/s
and1/s^1
are not allowed? \$\endgroup\$