Skip to content
Advertisement

How to use sympy to algebraically solve a two sided equation

I’d like to use sympy to solve he following equation in terms of x, g, and w.

enter image description here

Here’s what I thought I should code

JavaScript

But this seems to be trying to solve for a numerical answer.

Advertisement

Answer

You can create a 2-sided equation with Eq:

JavaScript

When you say that you want to solve “in terms of x, g and w” I’m not sure I understand what you mean. Do you mean that you want to solve for a in terms of the others? If so then you just have to ask to solve for a:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement