First, @roaminggamer, thank you very much for your help, I could not come here to answer you, because I'm at the end of the semester, every day next week has proof or work to present, it's a gigantic run, but I was already going to come here.

It turned out that I found its result there too great for my problem, it would work harder than if I broke my mind to do it in a functional way, then I sat down and managed to develop this Sorry for the variables being in Portuguese, but translate now would do a great job and I have to deliver this program tomorrow at 7pm)

if ValorDaValorDaCargaNaBarra ~= nil then
if AnguloDaForca == 90 then
SomaHorizontal = 0
SomaVertical = ValorDaValorDaCargaNaBarra
if DistanciaDaCarga > DistanciaApoioFixoNaBarra then
Soma = -ValorDaValorDaCargaNaBarra * (DistanciaDaCarga - DistanciaApoioFixoNaBarra)
else
Soma = ValorDaValorDaCargaNaBarra * (DistanciaApoioFixoNaBarra - DistanciaDaCarga)
end
else
-- Somatorio forças horizontais
SomaHorizontal = ValorDaValorDaCargaNaBarra * math.cos(math.rad(AnguloDaForca))
print("Fx = "..SomaHorizontal .. "Utilizando angulo de " .. AnguloDaForca)
if ApoioMovelNaBarra == nil then
Soma = ValorDaValorDaCargaNaBarra * math.sin(math.rad(AnguloDaForca))
SomaVertical = Soma
print("Fy = "..Soma .. "Utilizando angulo de " .. AnguloDaForca)
else
-- Somatorio Momento
if DistanciaDaCarga > DistanciaApoioFixoNaBarra then
Soma = -ValorDaValorDaCargaNaBarra * math.sin(math.rad(AnguloDaForca)) * (DistanciaDaCarga - DistanciaApoioFixoNaBarra)
--print("Soma = -"..ValorDaValorDaCargaNaBarra .. " * " .. math.sin(math.rad(AnguloDaForca)) .. " * (" .. DistanciaDaCarga .. " - " .. DistanciaApoioFixoNaBarra .. ")" )
SomaVertical = ValorDaValorDaCargaNaBarra * math.sin(math.rad(AnguloDaForca))
print("Fy = "..Soma .. "Utilizando angulo de " .. AnguloDaForca)
else
Soma = ValorDaValorDaCargaNaBarra * math.sin(math.rad(AnguloDaForca)) * (DistanciaApoioFixoNaBarra - DistanciaDaCarga)
print("Fy = "..Soma .. "Utilizando angulo de " .. AnguloDaForca)
end
end
end
end

I left the code here if someone in the future needs something like this

Thank you very much !

@davebollinger

Yes I know how to solve integral, derived, bla bla bla bla and all that chatura there, and me problem was not the resolution of the question (I would never do this program if it were depending on me, believe me, with a paper and a pen and a calculator I can solve it faster than someone entering the information, but this is worth 20 points, and 20 points at the end of the semester, right!

I do not go around thinking that anyone is a liar, I'm an engineering student, and probably what I study you've never heard of, (things like stratigraphy of rocks, lithodemic unit, igneous rock, metamorphic, particle grain, dungeon, etc), and yes, I still program but direct I come here to the forum ask for help, sometimes for things that may seem very simple for you being a bug of seven heads for me, after all, I did not do programming and also did not college I did some course, I am always learning every day that passes, one day who knows you still hear of me talking about some famous project hahahah

Note: my problem was not solving 2x + 18 = 0, my problem was an equation with a lot more problems than this, I wanted 0 to be a variable that would solve itself, without me having to tell the program to go there on the 18th then divide by 2, I wanted everything more automatic, if any 5th graders make me a program like that, well, then I would have to agree that my IQ might look a bit like his.

Bye bro