Tag Info

New answers tagged

0

Another way: use an immediate or delayed rule: NIntegrate[x^2*q /. q -> x, {x, 0, 10}] or change the replacement q->x on the fly using a function ff[x_]:= 1/(1-x) Table[ NIntegrate[x^2 q /. q:> ff[n x] ,{x,0,10}],{n,3}]


0

Maybe this is what you are looking for. x = 42.; Block[{x, q}, With[{q = x}, NIntegrate[x^2*q, {x, 0, 100}]]] 2.5*10^7 q q The Block construct declares x ansd q in the local scope. Also note, there is no need to use Print much in Mathematica, as the result of evaluating an expression or last expression in a compound expression ("statement") is ...


5

Assumptions are not used in normal evaluation, but only in certain functions like Simplify. Another, simpler example: In[1]:= $Assumptions = x \[Element] Reals Out[1]= x \[Element] Reals In[2]:= Conjugate[x] Out[2]= Conjugate[x] In[3]:= Simplify[%] Out[3]= x You see, during normal evaluation Mathematica doesn't recognize that x is supposed to be ...


1

I solved the problem with help and ideas from answers here, primarily inspiration from george2079's answer, by introducing a new function (so as not to alter the underlying definition of ArcTan). In the context of my research, this was actually quite natural, but might be a slight extra step for some. The solution works for arguments of the same ...


1

This preserves the two argument ArcTan form feature of returning a result in the correct quadrant, as well as handling the x=0 case.. arctan[x_, y_] /; QuantityUnit[x] == QuantityUnit[y] := ArcTan[ x , y] /. QuantityUnit[x] -> 1 ; arctan[x_,y_]:=ArcTan[x,y]; x = Quantity[-2, "Angstrom"]; y = Quantity[2 Sqrt[3], "Angstrom"]; ...


0

One simple enough way is to use a rule. For example, like this: rule = ArcTan[a_, b_] -> ArcTan[a/b]; Then your example is automatically done: ArcTan[3 a Sin[t/2], -3 a Sin[t/2]] /. rule (* -(\[Pi]/4) *) This might be combined with something else to transform the resulting ArcTan argument. Compare this: ArcTan[Log[x^2], -Log[x]] /. rule (* ...


0

You can get this to work by unprotecting ArcTan (or alternately making a wrapper for ArcTan). But, for example: Unprotect[ArcTan] ArcTan[common_, y_ common_] := ArcTan[1, y] ArcTan[x_ common_, common_] := ArcTan[x, 1] ArcTan[x_ common_, y_ common_] := ArcTan[x, y] ArcTan[x_ /common_, y_ /common_] := ArcTan[x, y] ArcTan[Quantity[x_, units_], Quantity[y_, ...


1

One way would be like the following. Let us define the function rule as follows: Clear[rule]; rule[expr_] := ReplaceAll[ expr, {Sin[2 γ_] -> 2*Sin[γ]*Cos[γ], Cos[2 γ_] -> Cos[γ]^2 - Sin[γ]^2}]; and map this function on your expression. For the sake of shortness I take here only a small part of your otherwise a too ...


4

If you steal the wizard's explanation an apply it to your case cf[e_] := 100 Count[e, _Abs, {0, Infinity}] + LeafCount[e] Then FullSimplify[Abs[x + I], x \[Element] Reals, ComplexityFunction -> cf] (* Sqrt[x^2+1] *) but once again I just copied and vaguely adapted the link provided by kuba


2

How about using ComplexExpand ComplexExpand[Abs[x + I]] Gives: Sqrt[1 + x^2]



Top 50 recent answers are included