|Well, I understand you may be disappointed, but be aware Programming Forum is a place where people post specific questions to get help assumed they master the required knowlege to implement the hints.|
Here the key point: you can get tips NOT a full class on the general issue. If you want help to solve an equation and you can't master algebra there is nothing to do. Your chatbot script is a programming challenge that needs a good knowledge of batch scripting and logic rules. According to my example this is not an algebraic eqution but advanced calculus.
First of all you need to own a strong knowledge of batch language and you can google to find websites offering free tutorials surely better than I can give (by the way English is not my mothertongue since I am italian). Then programming practice must follow; eventually you may find the required help on Programming Forum.
To see how complex may be batch scripting type help | more to get the full index of batch op codes and then explore them by help op-code (e.g. help set).
Houses are built from the basement not beginning from the roof.