On Mon, Feb 28, 2011 at 5:03 AM, zbynek.jano...@gmail.com <zbynek.jano...@centrum.cz> wrote: > Thanks, > Your advice solved the problem for one substitution, but I needed to > substitute twice: first s = (a+b+c)/2 > and than c = sqrt(a^2 + b^2 -2*a*b*cos(gamma)) and I hoped I can do it > simultaneously
There is no limitation to the number of substitutions using Ryacas: > library(Ryacas) > a <- Sym("a"); b <- Sym("b"); gamma <- Sym("gamma") > c <- sqrt(a^2 + b^2 -2*a*b*cos(gamma)) > s <- (a+b+c)/2 > deriv(s, a) [1] "Starting Yacas!" expression(2 * ((2 * a - 2 * b * cos(gamma))/(2 * root(a^2 + b^2 - 2 * a * b * cos(gamma), 2)) + 1)/4) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.