Group Abstract Group Abstract

Message Boards Message Boards

AlgebraicReplace: How to use?

Anonymous User
Anonymous User
Posted 1 month ago

Hi all,

I'm new here and have been using the Wolfram Alpha notebook edition to do some long integrations.

I'm to the point where I have some very complicated algebraic expressions within which I would like to make substitutions.

For example, I'd like to replace the expression "sqrt[x^2+y^2+z^2]" with the variable "r."

I found the command AlgebraicReplace but I can't make it work. https://resources.wolframcloud.com/FunctionRepository/resources/AlgebraicReplace/

I've tried to cut and paste the example from the source notebook at the link above. Although I can make it work within the sample notebook and even modify it, when I paste the command into my notebook, I get the error "No Wolfram Language translation found."

The command I've tried to copy and paste is this: ResourceFunction["AlgebraicReplace"][3x^3 - 7x^2y + 4xy^2 + y^3, xy, a]

Before copying the command, I used the Convert To command found by right-clicking on the input line to put the command into InputForm. (see the screen shot below) enter image description here

I feel like there is something I'm missing with making this work. I wouldn't be surprised if it something simple I haven't learned yet.

Any help you can provide would be greatly appreciated.

POSTED BY: Anonymous User

Maybe one of the following is what you have in mind:

ResourceFunction["AlgebraicReplace"][Sqrt[x^2 + y^2 + z^2], 
 x^2 + y^2 + z^2, r]
(*  Sqrt[r]  *)

ResourceFunction["AlgebraicReplace"][Sqrt[x^2 + y^2 + z^2], 
 x^2 + y^2 + z^2, r^2]
(*  Sqrt[r^2]  *)

ResourceFunction["AlgebraicReplace"][Sqrt[x^2 + y^2 + z^2], 
 Sqrt[x^2 + y^2 + z^2], r]
(*  r  *)

Note there are some possible errors in the code in your post. I assume sqrt should be Sqrt, the square-root function. And xy should be x y or x*y; this happened probably because the code is not formatted between backticks, not because the code you copied has syntax errors.

POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard