我想:
示例
func1 <-function(x,y) {
return((x^3-3*x*y))
}
#input x=1/n and y=1/n
#the desired result should be
#1st: (1/n)^3-3*(1/n)*(1/n)
#2nd: 1/n^3 - 3/n^2 = 1/n^2*(1/n - 3)
有什么想法吗?
发布于 2021-02-27 21:40:14
试试这个:
library(Ryacas)
n <- ysym("n")
x <- 1/n
y <- 1/n
simplify(x^3-3*x*y)
## y: ((-3)*n^3+n^2)/n^5
https://stackoverflow.com/questions/66399313
复制相似问题